misc: add django-upgrade files/notes (#69798)
gitea-wip/combo/pipeline/head Build started... Details
gitea/combo/pipeline/head Something is wrong with the build of this commit Details

This commit is contained in:
Valentin Deniaud 2022-10-03 14:21:42 +02:00
parent cd498afcb0
commit 84fb0e9ab0
3 changed files with 18 additions and 8 deletions

View File

@ -6,3 +6,5 @@
f4615c506194cf4eace0af551f14f54552f09dc5
# misc: apply djhtml (#69709)
4784a3990eec0aadadce99bf1da21c0b531b289d
# misc: apply django-upgrade (#69798)
cd498afcb0bcd8d3f2fce98c9747ca1406d9a449

View File

@ -1,6 +1,16 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.20.0
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:
@ -11,11 +21,6 @@ repos:
hooks:
- id: isort
args: ['--profile', 'black', '--line-length', '110']
- repo: https://github.com/asottile/pyupgrade
rev: v2.20.0
hooks:
- id: pyupgrade
args: ['--keep-percent-format', '--py37-plus']
- repo: https://github.com/rtts/djhtml
rev: 'v1.5.2'
hooks:

9
README
View File

@ -108,9 +108,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.)
License