From e1c5d834b0778878632a37bda1db050204729fba Mon Sep 17 00:00:00 2001 From: Valentin Deniaud Date: Thu, 22 Sep 2022 11:20:49 +0200 Subject: [PATCH 3/3] misc: add django-upgrade files/notes (#69426) --- .git-blame-ignore-revs | 2 ++ .pre-commit-config.yaml | 5 +++++ README | 8 ++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index c73b13f80..475b6db42 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -8,3 +8,5 @@ a265c6267e75c831b8294a760f94b9d6cffb92ea 7bc0fcadffd16564cc200cb2f32fae80b3c3a5cf # misc: apply black 22.1.0 09c2a08d113b2194697fc0a3925d569184babe97 +# misc: apply django-upgrade (#69426) +2457c72d61992596a1c3873192ea77b442d82230 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c4fd3dccb..a89b4e920 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,6 +6,11 @@ repos: hooks: - id: pyupgrade args: ['--keep-percent-format', '--py37-plus'] +- repo: https://github.com/adamchainz/django-upgrade + rev: 1.10.0 + hooks: + - id: django-upgrade + args: ['--target-version', '2.2'] - repo: https://github.com/psf/black rev: 22.3.0 hooks: diff --git a/README b/README index f33743a03..e76c4d950 100644 --- a/README +++ b/README @@ -87,9 +87,13 @@ pyupgrade is used to automatically upgrade syntax, using those parameters: pyupgrade --keep-percent-format --py37-plus +django-upgrade is used to automatically upgrade Django syntax, using those parameters: + + django-upgrade --target-version 2.2 + 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.) +isort, pyupgrade, and django-upgrade before commits. (execute `pre-commit install` +to install the git hook.) Support ======= -- 2.30.2