misc: add pyupgrade files/notes (#55519)
This commit is contained in:
parent
7bc0fcadff
commit
fdd3f15aa7
|
@ -4,3 +4,5 @@
|
||||||
86d946adcdc784693d733131c2aecafc6caa8cbb
|
86d946adcdc784693d733131c2aecafc6caa8cbb
|
||||||
# misc: remove unicode prefixed strings
|
# misc: remove unicode prefixed strings
|
||||||
a265c6267e75c831b8294a760f94b9d6cffb92ea
|
a265c6267e75c831b8294a760f94b9d6cffb92ea
|
||||||
|
# misc: apply pyupgrade
|
||||||
|
7bc0fcadffd16564cc200cb2f32fae80b3c3a5cf
|
||||||
|
|
|
@ -11,3 +11,8 @@ repos:
|
||||||
hooks:
|
hooks:
|
||||||
- id: isort
|
- id: isort
|
||||||
args: ['--profile', 'black', '--line-length', '110']
|
args: ['--profile', 'black', '--line-length', '110']
|
||||||
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
|
rev: v2.20.0
|
||||||
|
hooks:
|
||||||
|
- id: pyupgrade
|
||||||
|
args: ['--keep-percent-format', '--py37-plus']
|
||||||
|
|
8
README
8
README
|
@ -83,6 +83,14 @@ isort is used to format the imports, using those parameter:
|
||||||
|
|
||||||
isort --profile black --line-length 110
|
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 run black,
|
||||||
|
isort and pyupgrade before commits. (execute `pre-commit install` to install
|
||||||
|
the git hook.)
|
||||||
|
|
||||||
Support
|
Support
|
||||||
=======
|
=======
|
||||||
|
|
||||||
|
|
3
tox.ini
3
tox.ini
|
@ -113,8 +113,7 @@ skip_install = true
|
||||||
deps =
|
deps =
|
||||||
pre-commit
|
pre-commit
|
||||||
commands =
|
commands =
|
||||||
pre-commit run black --all-files --show-diff-on-failure
|
pre-commit run --all-files --show-diff-on-failure
|
||||||
pre-commit run isort --all-files --show-diff-on-failure
|
|
||||||
|
|
||||||
[pytest]
|
[pytest]
|
||||||
filterwarnings =
|
filterwarnings =
|
||||||
|
|
Loading…
Reference in New Issue