configure pre-commit
This commit is contained in:
parent
370e16b117
commit
6a8dfb6424
|
@ -0,0 +1,30 @@
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
|
rev: v2.11.0
|
||||||
|
hooks:
|
||||||
|
- id: pyupgrade
|
||||||
|
args:
|
||||||
|
- --keep-percent-format
|
||||||
|
|
||||||
|
- repo: https://github.com/psf/black
|
||||||
|
rev: 20.8b1
|
||||||
|
hooks:
|
||||||
|
- id: black
|
||||||
|
|
||||||
|
- repo: https://gitlab.com/pycqa/flake8
|
||||||
|
rev: 3.9.0
|
||||||
|
hooks:
|
||||||
|
- id: flake8
|
||||||
|
|
||||||
|
- repo: https://github.com/asottile/yesqa
|
||||||
|
rev: v1.2.2
|
||||||
|
hooks:
|
||||||
|
- id: yesqa
|
||||||
|
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v3.4.0
|
||||||
|
hooks:
|
||||||
|
- id: check-merge-conflict
|
||||||
|
- id: check-toml
|
||||||
|
- id: check-yaml
|
||||||
|
- id: mixed-line-ending
|
|
@ -24,11 +24,9 @@ matrix:
|
||||||
env: TOX_ENV=tests
|
env: TOX_ENV=tests
|
||||||
- python: 3.9
|
- python: 3.9
|
||||||
env: TOX_ENV=tests
|
env: TOX_ENV=tests
|
||||||
- env: TOX_ENV=black
|
|
||||||
- env: TOX_ENV=mypy
|
- env: TOX_ENV=mypy
|
||||||
- env: TOX_ENV=apidocs
|
- env: TOX_ENV=apidocs
|
||||||
- env: PUSH_DOCS=true
|
- env: PUSH_DOCS=true
|
||||||
- env: TOX_ENV=check-manifest
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- if [[ -n "${TOX_ENV}" ]]; then tox -e $TOX_ENV; fi
|
- if [[ -n "${TOX_ENV}" ]]; then tox -e $TOX_ENV; fi
|
||||||
|
|
|
@ -48,3 +48,8 @@ mypy =
|
||||||
|
|
||||||
[bdist_wheel]
|
[bdist_wheel]
|
||||||
universal = 1
|
universal = 1
|
||||||
|
|
||||||
|
[flake8]
|
||||||
|
max-line-length = 88
|
||||||
|
extend-ignore =
|
||||||
|
E203, # whitespace before : is not PEP8 compliant (& conflicts with black)
|
||||||
|
|
16
tox.ini
16
tox.ini
|
@ -7,7 +7,6 @@ isolated_build = true
|
||||||
envlist =
|
envlist =
|
||||||
flake8,
|
flake8,
|
||||||
tests,
|
tests,
|
||||||
check-manifest,
|
|
||||||
apidocs
|
apidocs
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,25 +16,18 @@ wheel_build_env = build
|
||||||
deps =
|
deps =
|
||||||
tests: coverage
|
tests: coverage
|
||||||
apidocs: pydoctor
|
apidocs: pydoctor
|
||||||
check-manifest: check-manifest
|
lint: pre-commit
|
||||||
black: black
|
|
||||||
black-reformat: black
|
|
||||||
extras =
|
extras =
|
||||||
mypy: mypy
|
mypy: mypy
|
||||||
tests: scripts
|
tests: scripts
|
||||||
|
|
||||||
setenv =
|
|
||||||
black: BLACK_LINT_ARGS=--check
|
|
||||||
|
|
||||||
commands =
|
commands =
|
||||||
python -V
|
python -V
|
||||||
|
|
||||||
black: black {env:BLACK_LINT_ARGS} .
|
lint: pre-commit run --all-files --show-diff-on-failure
|
||||||
|
|
||||||
apidocs: pydoctor -q --project-name incremental src/incremental
|
apidocs: pydoctor -q --project-name incremental src/incremental
|
||||||
|
|
||||||
check-manifest: check-manifest -v
|
|
||||||
|
|
||||||
tests: coverage --version
|
tests: coverage --version
|
||||||
tests: {envbindir}/trial --version
|
tests: {envbindir}/trial --version
|
||||||
tests: coverage erase
|
tests: coverage erase
|
||||||
|
@ -47,10 +39,6 @@ commands =
|
||||||
tests: coverage html
|
tests: coverage html
|
||||||
mypy: mypy src
|
mypy: mypy src
|
||||||
|
|
||||||
[testenv:black-reformat]
|
|
||||||
setenv =
|
|
||||||
; Clear the --check flag
|
|
||||||
BLACK_LINT_ARGS=
|
|
||||||
|
|
||||||
[testenv:build]
|
[testenv:build]
|
||||||
# empty environment to build universal wheel once per tox invocation
|
# empty environment to build universal wheel once per tox invocation
|
||||||
|
|
Loading…
Reference in New Issue