From b991ea0ad775624a43c90d58f34210d2b94af86c Mon Sep 17 00:00:00 2001 From: Valentin Deniaud Date: Thu, 29 Sep 2022 15:22:36 +0200 Subject: [PATCH] misc: add pyugrade files/notes (#69708) --- .git-blame-ignore-revs | 2 ++ .pre-commit-config.yaml | 5 +++++ README | 6 +++++- 3 files changed, 12 insertions(+), 1 deletion(-) 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.)