mirror of
https://github.com/davegallant/rfd.git
synced 2025-08-06 08:43:41 +00:00
add pre-commit and enforce on travis (#37)
* add pre-commit and enforce on travis
This commit is contained in:
8
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
8
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
*Description of changes:*
|
||||||
|
|
||||||
|
*Checklist:*
|
||||||
|
|
||||||
|
- [ ] Write unit tests
|
||||||
|
- [ ] `make pr` passes
|
||||||
|
- [ ] Write documentation
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -6,4 +6,4 @@
|
|||||||
.vscode/
|
.vscode/
|
||||||
build/
|
build/
|
||||||
dist/
|
dist/
|
||||||
venv/
|
venv/
|
||||||
|
19
.pre-commit-config.yaml
Normal file
19
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v2.3.0
|
||||||
|
hooks:
|
||||||
|
- id: check-added-large-files
|
||||||
|
- id: check-ast
|
||||||
|
- id: check-case-conflict
|
||||||
|
- id: check-json
|
||||||
|
- id: check-merge-conflict
|
||||||
|
- id: check-yaml
|
||||||
|
- id: debug-statements
|
||||||
|
- id: detect-aws-credentials
|
||||||
|
args: [--allow-missing-credentials]
|
||||||
|
- id: detect-private-key
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: pretty-format-json
|
||||||
|
args: [--autofix]
|
||||||
|
- id: requirements-txt-fixer
|
||||||
|
- id: trailing-whitespace
|
@@ -11,11 +11,10 @@ matrix:
|
|||||||
dist: xenial
|
dist: xenial
|
||||||
sudo: true
|
sudo: true
|
||||||
before_install:
|
before_install:
|
||||||
- "pip install -U pip"
|
- pip install -U pip
|
||||||
- "python setup.py install"
|
|
||||||
install:
|
install:
|
||||||
- pip install tox-travis
|
- python setup.py install
|
||||||
- pip install pytest
|
- pip install -r requirements_dev.txt
|
||||||
- pip install pylint
|
- git diff --name-only $TRAVIS_COMMIT_RANGE | xargs pre-commit run --files
|
||||||
script:
|
script:
|
||||||
- tox
|
- tox
|
||||||
|
@@ -1,3 +1,3 @@
|
|||||||
include requirements.txt
|
include requirements.txt
|
||||||
include requirements_dev.txt
|
include requirements_dev.txt
|
||||||
include rfd/__version__.py
|
include rfd/__version__.py
|
||||||
|
29
Makefile
29
Makefile
@@ -1,10 +1,35 @@
|
|||||||
|
|
||||||
build:
|
SRC:=rfd
|
||||||
|
|
||||||
|
.PHONY: build
|
||||||
|
build:
|
||||||
rm -rf dist/
|
rm -rf dist/
|
||||||
python setup.py sdist
|
python setup.py sdist
|
||||||
|
|
||||||
|
.PHONY: push_test
|
||||||
push_test:
|
push_test:
|
||||||
twine upload -r testpypi dist/*.tar.gz
|
twine upload -r testpypi dist/*.tar.gz
|
||||||
|
|
||||||
|
.PHONY: push_prod
|
||||||
push_prod:
|
push_prod:
|
||||||
twine upload dist/*.tar.gz
|
twine upload dist/*.tar.gz
|
||||||
|
|
||||||
|
.PHONY: precommit
|
||||||
|
precommit: ## Run pre-commit
|
||||||
|
pre-commit run \
|
||||||
|
--all-files \
|
||||||
|
--show-diff-on-failure
|
||||||
|
|
||||||
|
.PHONY: lint
|
||||||
|
lint:
|
||||||
|
pylint $(SRC)
|
||||||
|
|
||||||
|
.PHONY: test
|
||||||
|
test:
|
||||||
|
pytest -v
|
||||||
|
|
||||||
|
.PHONY: pr
|
||||||
|
pr: precommit lint test
|
||||||
|
|
||||||
|
.PHONY: ci
|
||||||
|
ci: lint test
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
beautifulsoup4>=4.6.0
|
beautifulsoup4>=4.6.0
|
||||||
click>=7.0
|
click>=7.0
|
||||||
colorama>=0.3.9
|
colorama>=0.3.9
|
||||||
requests>=2.18.0
|
requests>=2.18.0
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
black==19.3b0
|
pre-commit==1.18.3
|
||||||
pylint==2.4.2
|
pylint
|
||||||
pytest==5.2.1
|
pytest>=4.6.6
|
||||||
pytest-sugar==0.9.2
|
|
||||||
rope==0.14.0
|
rope==0.14.0
|
||||||
|
tox-travis==0.12
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
"""This module provides utility functions that are used within rfd"""
|
"""This module provides utility functions that are used within rfd"""
|
||||||
|
|
||||||
|
|
||||||
def is_int(number):
|
def is_int(number):
|
||||||
try:
|
try:
|
||||||
int(number)
|
int(number)
|
||||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user