misc: add pyupgrade files/notes (#55868)
gitea-wip/combo/pipeline/head There was a failure building this commit Details
gitea/combo/pipeline/head Build started... Details

This commit is contained in:
Lauréline Guérin 2021-07-27 16:29:05 +02:00
parent f4615c5061
commit 70d699b0a4
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
3 changed files with 14 additions and 2 deletions

View File

@ -2,3 +2,5 @@
47d67c395ef124ea4534ea7c56d48d4e302db430
# misc: apply isort (#52797)
29bc8e66a978b1bbadbc05186599a70ce1b8ef98
# misc: apply pyupgrade (#55868)
f4615c506194cf4eace0af551f14f54552f09dc5

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

@ -100,8 +100,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.)
License