misc: add isort (#52797)
This commit is contained in:
parent
1cfd7e90c4
commit
6c6d7bac40
|
@ -6,3 +6,8 @@ repos:
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
args: ['--target-version', 'py37', '--skip-string-normalization', '--line-length', '110']
|
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
|
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.)
|
before commits. (execute `pre-commit install` to install the git hook.)
|
||||||
|
|
||||||
|
|
||||||
|
|
6
tox.ini
6
tox.ini
|
@ -1,6 +1,6 @@
|
||||||
[tox]
|
[tox]
|
||||||
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/combo/{env:BRANCH_NAME:}
|
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]
|
[testenv]
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
|
@ -32,11 +32,11 @@ deps =
|
||||||
vobject
|
vobject
|
||||||
django-ratelimit<3
|
django-ratelimit<3
|
||||||
git+https://git.entrouvert.org/debian/django-ckeditor.git
|
git+https://git.entrouvert.org/debian/django-ckeditor.git
|
||||||
black: pre-commit
|
pre-commit
|
||||||
uwsgidecorators
|
uwsgidecorators
|
||||||
commands =
|
commands =
|
||||||
./getlasso3.sh
|
./getlasso3.sh
|
||||||
python manage.py compilemessages
|
python manage.py compilemessages
|
||||||
py.test {env:COVERAGE:} {posargs: --junitxml=junit-{envname}.xml tests/}
|
py.test {env:COVERAGE:} {posargs: --junitxml=junit-{envname}.xml tests/}
|
||||||
pylint: ./pylint.sh combo/
|
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