misc: add pyupgrade files/notes (#55519)

This commit is contained in:
Valentin Deniaud 2021-07-12 11:59:31 +02:00
parent 7bc0fcadff
commit fdd3f15aa7
4 changed files with 16 additions and 2 deletions

View File

@ -4,3 +4,5 @@
86d946adcdc784693d733131c2aecafc6caa8cbb
# misc: remove unicode prefixed strings
a265c6267e75c831b8294a760f94b9d6cffb92ea
# misc: apply pyupgrade
7bc0fcadffd16564cc200cb2f32fae80b3c3a5cf

View File

@ -11,3 +11,8 @@ repos:
hooks:
- id: isort
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
View File

@ -83,6 +83,14 @@ isort is used to format the imports, using those parameter:
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
=======

View File

@ -113,8 +113,7 @@ skip_install = true
deps =
pre-commit
commands =
pre-commit run black --all-files --show-diff-on-failure
pre-commit run isort --all-files --show-diff-on-failure
pre-commit run --all-files --show-diff-on-failure
[pytest]
filterwarnings =