misc: add isort (#52856)
This commit is contained in:
parent
b0a75384e9
commit
b26638f946
|
@ -6,3 +6,8 @@ repos:
|
|||
hooks:
|
||||
- id: black
|
||||
args: ['--target-version', 'py37', '--skip-string-normalization', '--line-length', '110']
|
||||
- repo: https://github.com/PyCQA/isort
|
||||
rev: 5.7.0
|
||||
hooks:
|
||||
- id: isort
|
||||
args: ['--profile', 'black', '--line-length', '110']
|
||||
|
|
6
README
6
README
|
@ -36,7 +36,11 @@ black is used to format the code, using thoses parameters:
|
|||
|
||||
black --target-version py35 --skip-string-normalization --line-length 110
|
||||
|
||||
There is .pre-commit-config.yaml to use pre-commit to automatically run black
|
||||
isort is used to format the imports, using those parameters:
|
||||
|
||||
isort --profile black --line-length 110
|
||||
|
||||
There is .pre-commit-config.yaml to use pre-commit to automatically run black and isort
|
||||
before commits. (execute `pre-commit install` to install the git hook.)
|
||||
|
||||
|
||||
|
|
6
tox.ini
6
tox.ini
|
@ -1,5 +1,5 @@
|
|||
[tox]
|
||||
envlist = py3-django111-pg-black-coverage-pylint, py3-django22-pg
|
||||
envlist = py3-django111-pg-codestyle-coverage-pylint, py3-django22-pg
|
||||
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/chrono/{env:BRANCH_NAME:}
|
||||
|
||||
[testenv]
|
||||
|
@ -32,10 +32,10 @@ deps =
|
|||
django22: django>=2.2,<2.3
|
||||
django111: djangorestframework<3.12.0
|
||||
psycopg2-binary
|
||||
pre-commit
|
||||
codestyle: pre-commit
|
||||
commands =
|
||||
./getlasso3.sh
|
||||
python3 setup.py compile_translations
|
||||
py.test {env:COVERAGE:} {posargs:tests/}
|
||||
pylint: ./pylint.sh chrono/
|
||||
black: pre-commit run black --all-files --show-diff-on-failure
|
||||
codestyle: pre-commit run --all-files --show-diff-on-failure
|
||||
|
|
Loading…
Reference in New Issue