misc: add django-upgrade files/notes (#69426)

This commit is contained in:
Valentin Deniaud 2022-09-22 11:20:49 +02:00
parent 0bec12d61d
commit 3c97499ba6
3 changed files with 13 additions and 3 deletions

View File

@ -10,3 +10,5 @@ a265c6267e75c831b8294a760f94b9d6cffb92ea
09c2a08d113b2194697fc0a3925d569184babe97
# misc: apply djhtml (#69422)
8251b8188fb57414214ace63459156b43ddda46d
# misc: apply django-upgrade (#69426)
0bec12d61de2de7f812f5055de2724942beeedb5

View File

@ -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:

9
README
View File

@ -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
=======