misc: add isort (#58937)
gitea/eopayment/pipeline/head Build started... Details

This commit is contained in:
Serghei Mihai 2021-11-24 13:14:46 +01:00
parent 8bf4ab81c5
commit 3afaa1148a
3 changed files with 15 additions and 4 deletions

View File

@ -2,3 +2,5 @@
caa40e7e771b41bd1d164341a2e7f40689cbe4ba
# trivial: apply black (#58937)
3ee72e5336d03526c7ab297a5cf09057a6d5d1c2
# trivial: apply isort (#58937)
8bf4ab81c5483af946365645d15708796c832d7e

View File

@ -6,6 +6,11 @@ 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']
- repo: https://github.com/asottile/pyupgrade
rev: v2.20.0
hooks:

View File

@ -187,13 +187,17 @@ 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
before commits. (execute `pre-commit install` to install the git hook.)
isort is used to format the imports, using those parameters:
isort --profile black --line-length 110
pyupgrade is used to automatically upgrade syntax, using those parameters:
pyupgrade --keep-percent-format --py37-plus
There is .pre-commit-config.yaml to use pre-commit to automatically pyupgrade
before commits. (execute `pre-commit install` to install the git hook.)
There is .pre-commit-config.yaml to use pre-commit to automatically run black,
isort and pyupgrade before commits. (execute `pre-commit install` to install
the git hook.)