diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 725cb56e7..003345913 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -10,3 +10,5 @@ a265c6267e75c831b8294a760f94b9d6cffb92ea 09c2a08d113b2194697fc0a3925d569184babe97 # misc: apply djhtml (#69422) 8251b8188fb57414214ace63459156b43ddda46d +# misc: apply django-upgrade (#69426) +0bec12d61de2de7f812f5055de2724942beeedb5 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1c607f2f6..030c42fbd 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 987a51e89..469b03aa3 100644 --- a/README +++ b/README @@ -91,9 +91,12 @@ djhtml is used to automatically indent html files, using those parameters: djhtml --tabwidth 2 -There is .pre-commit-config.yaml to use pre-commit to automatically run black, -isort, pyupgrade, and djhtml before commits. (execute `pre-commit install` -to install the git hook.) +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.) Support =======