0002-misc-add-isort-files-notes-55470.patch
.git-blame-ignore-revs | ||
---|---|---|
1 | 1 |
# trivial: apply black |
2 | 2 |
2bf37aaa7e459d429fca284f2de60add5841d063 |
3 |
# trivial: apply isort (#55470) |
|
4 |
44bfd4a0afbfe704ac2580eeb35a68b7845878a0 |
.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'] |
README | ||
---|---|---|
15 | 15 |
Code Style |
16 | 16 |
---------- |
17 | 17 | |
18 |
black is used to format the Python code, using thoses parameters:
|
|
18 |
black is used to format the Python code, using these parameters:
|
|
19 | 19 | |
20 | 20 |
black --target-version py37 --skip-string-normalization --line-length 110 |
21 | 21 | |
22 |
Similarly, isort is used for imports, using these parameters: |
|
23 | ||
24 |
isort --profile black --line-length 110 |
|
25 | ||
22 | 26 |
There is .pre-commit-config.yaml to use pre-commit to automatically run black |
23 |
before commits. (execute `pre-commit install` to install the git hook.) |
|
27 |
and isort before commits. (execute `pre-commit install` to install the git |
|
28 |
hook.) |
|
24 | 29 | |
25 | 30 | |
26 | 31 |
License |
27 |
- |