misc: add isort files/notes (#55470)

This commit is contained in:
Paul Marillonnet 2021-07-08 11:57:26 +02:00 committed by Frédéric Péters
parent 0f75316e1b
commit 1ebef30dbe
3 changed files with 14 additions and 2 deletions

View File

@ -1,2 +1,4 @@
# trivial: apply black
2bf37aaa7e459d429fca284f2de60add5841d063
# trivial: apply isort (#55470)
0f75316e1b9a70e311d2971e75b32f84b00f487a

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

9
README
View File

@ -15,12 +15,17 @@ Variables
Code Style
----------
black is used to format the Python code, using thoses parameters:
black is used to format the Python code, using these parameters:
black --target-version py37 --skip-string-normalization --line-length 110
Similarly, isort is used for imports, using these parameters:
isort --profile black --line-length 110
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.)
and isort before commits. (execute `pre-commit install` to install the git
hook.)
License