From 7b274e9b9a59601d7f4b96a9eec9abae7eecc6d6 Mon Sep 17 00:00:00 2001 From: Valentin Deniaud Date: Thu, 29 Sep 2022 15:27:00 +0200 Subject: [PATCH 2/2] misc: add pyugrade files/notes (#61865) --- .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 f2d6c59a..44f844eb 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -4,3 +4,5 @@ 06db6d8767c2f032beced88f3f374c7630a152d1 # misc: apply black 22.1.0 d2c0be039649febded68d9d04f745cd18b2b2e03 +# misc: apply pyupgrade (#61865) +9c4f5d22098d7741f20f6562692789cf4810132e diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8125b5a0..c4fd3dcc 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 379958b9..cee8b3bc 100644 --- a/README +++ b/README @@ -66,7 +66,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 +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.) The .git-blame-ignore-revs file could be used to hide the related -- 2.35.1