diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 4afe207..a828448 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -2,3 +2,5 @@ 872f39774a43db59ffc4bbddc77ad3a33ba7ead2 # misc: apply black 22.1.0 f014f154640dc30fd27662ec6d93ae6e64125ea3 +# misc: apply pyupgrade (#69708) +a107b7ef0e847882dcd6d5fc8c39e8feccc5705e diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8125b5a..c4fd3dc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,11 @@ # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks repos: +- repo: https://github.com/asottile/pyupgrade + rev: v2.20.0 + hooks: + - id: pyupgrade + args: ['--keep-percent-format', '--py37-plus'] - repo: https://github.com/psf/black rev: 22.3.0 hooks: diff --git a/README b/README index 2410fcf..148cc12 100644 --- a/README +++ b/README @@ -184,7 +184,11 @@ 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 +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 these tools before commits. (execute `pre-commit install` to install the git hook.)