0002-misc-add-isort-pyupgrade-notes-60931.patch
.git-blame-ignore-revs | ||
---|---|---|
1 | 1 |
# trivial: apply black |
2 | 2 |
7a234d5fe7ae6bee3ba1d0f688967e8e6cf209e3 |
3 |
# trivial: apply isort & pyupgrade |
|
4 |
1abbbadd9469a3f2ff7eafb0ec6956c2b1c6763c |
.pre-commit-config.yaml | ||
---|---|---|
6 | 6 |
hooks: |
7 | 7 |
- id: black |
8 | 8 |
args: ['--target-version', 'py37', '--skip-string-normalization', '--line-length', '110'] |
9 |
- repo: https://github.com/PyCQA/isort |
|
10 |
rev: 5.7.0 |
|
11 |
hooks: |
|
12 |
- id: isort |
|
13 |
args: ['--profile', 'black', '--line-length', '110'] |
|
14 |
- repo: https://github.com/asottile/pyupgrade |
|
15 |
rev: v2.20.0 |
|
16 |
hooks: |
|
17 |
- id: pyupgrade |
|
18 |
args: ['--keep-percent-format', '--py37-plus'] |
README | ||
---|---|---|
28 | 28 | |
29 | 29 |
black --target-version py37 --skip-string-normalization --line-length 110 |
30 | 30 | |
31 |
There is .pre-commit-config.yaml to use pre-commit to automatically run black |
|
32 |
before commits. (execute `pre-commit install` to install the git hook.) |
|
31 |
isort is used to format the imports, using those parameter: |
|
32 | ||
33 |
isort --profile black --line-length 110 |
|
34 | ||
35 |
pyupgrade is used to automatically upgrade syntax, using those parameters: |
|
36 | ||
37 |
pyupgrade --keep-percent-format --py37-plus |
|
38 | ||
39 |
There is .pre-commit-config.yaml to use pre-commit to automatically run black, |
|
40 |
isort and pyupgrade before commits. (execute `pre-commit install` to install |
|
41 |
the git hook.) |
|
33 | 42 | |
34 | 43 | |
35 | 44 |
License |
36 |
- |