misc: add isort (#52797)
This commit is contained in:
parent
1cfd7e90c4
commit
6c6d7bac40
|
@ -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
|
@ -96,7 +96,11 @@ black is used to format the code, using thoses parameters:
|
|||
|
||||
black --target-version py37 --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,6 +1,6 @@
|
|||
[tox]
|
||||
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/combo/{env:BRANCH_NAME:}
|
||||
envlist = coverage-py3-django111-black-pylint-{sqlite,pg},py3-django22-pg
|
||||
envlist = coverage-py3-django111-codestyle-pylint-{sqlite,pg},py3-django22-pg
|
||||
|
||||
[testenv]
|
||||
usedevelop = True
|
||||
|
@ -32,11 +32,11 @@ deps =
|
|||
vobject
|
||||
django-ratelimit<3
|
||||
git+https://git.entrouvert.org/debian/django-ckeditor.git
|
||||
black: pre-commit
|
||||
pre-commit
|
||||
uwsgidecorators
|
||||
commands =
|
||||
./getlasso3.sh
|
||||
python manage.py compilemessages
|
||||
py.test {env:COVERAGE:} {posargs: --junitxml=junit-{envname}.xml tests/}
|
||||
pylint: ./pylint.sh combo/
|
||||
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