misc: add pyupgrade files/notes (#55867)

This commit is contained in:
Lauréline Guérin 2021-07-27 15:22:37 +02:00
parent 1ec4ad9376
commit 489198a8a6
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
3 changed files with 14 additions and 2 deletions

View File

@ -11,3 +11,5 @@ e07c450d7c8a5f80aafe185c85ebed73fe39d9e7
30bbc8c90f35f0cc49bfdb4244ff856d6766032d
# misc: apply isort (#52856)
34224c56aa3b855a6cfcf96af8f315c620eaa430
# misc: apply pyupgrade (#55867)
1ec4ad937602a52db6913e8ee9103fdb59be59f7

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']

9
README
View File

@ -40,8 +40,13 @@ isort is used to format the imports, using those parameters:
isort --profile black --line-length 110
There is .pre-commit-config.yaml to use pre-commit to automatically run black and isort
before commits. (execute `pre-commit install` to install the git hook.)
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.)
Tests