From 5ddd5fdc19fcd9059102512e633e76bf9e66ff60 Mon Sep 17 00:00:00 2001 From: Valentin Deniaud Date: Wed, 21 Sep 2022 17:08:45 +0200 Subject: [PATCH 1/2] misc: add django-upgrade files/notes (#69401) --- .pre-commit-config.yaml | 5 +++++ README | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 793766a5..09dcdd59 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,6 +16,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://git.entrouvert.org/pre-commit-debian.git rev: v0.1 hooks: diff --git a/README b/README index 084be019..0aa9d9c0 100644 --- a/README +++ b/README @@ -44,9 +44,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.) Tests -- 2.30.2