From 3714d46bef124ee853df8bb77011d9b75a3fc0aa Mon Sep 17 00:00:00 2001 From: Valentin Deniaud Date: Thu, 29 Sep 2022 15:27:00 +0200 Subject: [PATCH] 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..ae46e2be 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) +989fb5271967e8e87fd57837dd6d8cfe932e7ebe 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