diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 6691c2e..7979f7a 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -6,3 +6,5 @@ f014f154640dc30fd27662ec6d93ae6e64125ea3 a107b7ef0e847882dcd6d5fc8c39e8feccc5705e # misc: apply djhtml (#69422) a5ec15a465840c454ed1d94547be821523fed473 +# misc: apply django-upgrade (#69798) +5a6b5c5cd2efad36be91c39fc0cc9326cac7e6e6 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1c607f2..030c42f 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 7c72ffc..698ed46 100644 --- a/README +++ b/README @@ -192,6 +192,10 @@ djhtml is used to automatically indent html files, using those parameters: djhtml --tabwidth 2 +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 these tools before commits. (execute `pre-commit install` to install the git hook.)