add isort configuration (#52457)

This commit is contained in:
Valentin Deniaud 2021-03-30 10:34:19 +02:00
parent 86d946adcd
commit 41e2c8eee3
4 changed files with 12 additions and 0 deletions

View File

@ -1,2 +1,4 @@
# misc: apply black
4bb33d3d3c62516cfdb1ff5bba9216936a07d368
# misc: apply isort
86d946adcdc784693d733131c2aecafc6caa8cbb

View File

@ -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']

4
README
View File

@ -78,6 +78,10 @@ black is used to format the code, using thoses parameters:
There is .pre-commit-config.yaml to use pre-commit to automatically run black
before commits. (execute `pre-commit install` to install the git hook.)
isort is used to format the imports, using those parameter:
isort --force-single-line-imports --line-length 110
Support
=======

View File

@ -113,6 +113,7 @@ deps =
pre-commit
commands =
pre-commit run black --all-files --show-diff-on-failure
pre-commit run isort --all-files --show-diff-on-failure
[pytest]
filterwarnings =