misc: add django-upgrade files/notes (#69798)
gitea-wip/passerelle/pipeline/head There was a failure building this commit Details
gitea/passerelle/pipeline/head Something is wrong with the build of this commit Details

This commit is contained in:
Valentin Deniaud 2022-10-03 14:14:38 +02:00
parent e97305bc9b
commit 13ebe8b5bd
2 changed files with 9 additions and 0 deletions

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:

4
README
View File

@ -74,6 +74,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.)