From 6a8ebfcfd23b8839415e980cb30e418ffa74a88b Mon Sep 17 00:00:00 2001 From: Valentin Deniaud Date: Wed, 21 Sep 2022 17:37:13 +0200 Subject: [PATCH] misc: add djhtml files/notes (#69404) --- .git-blame-ignore-revs | 2 ++ .pre-commit-config.yaml | 5 +++++ README | 8 ++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index e54d241c..36699515 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -15,3 +15,5 @@ e07c450d7c8a5f80aafe185c85ebed73fe39d9e7 1ec4ad937602a52db6913e8ee9103fdb59be59f7 # misc: apply black 22.1.0 87e8203e0765948ecb8dd38b2fb3dc7195d561c9 +# misc: apply djhtml (#69404) +7c0eb04c453f50cdffe0095148aa52580c20143e diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 09dcdd59..a7c65a76 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,6 +21,11 @@ repos: hooks: - id: django-upgrade args: ['--target-version', '2.2'] +- repo: https://github.com/rtts/djhtml + rev: 'v1.5.2' + hooks: + - id: djhtml + args: ['--tabwidth', '2'] - repo: https://git.entrouvert.org/pre-commit-debian.git rev: v0.1 hooks: diff --git a/README b/README index 0aa9d9c0..0aa56faa 100644 --- a/README +++ b/README @@ -48,9 +48,13 @@ django-upgrade is used to automatically upgrade Django syntax, using those param django-upgrade --target-version 2.2 +djhtml is used to automatically indent html files, using those parameters: + + django-upgrade --tabwidth 2 + There is .pre-commit-config.yaml to use pre-commit to automatically run black, -isort, pyupgrade and django-upgrade before commits. (execute `pre-commit install` -to install the git hook.) +isort, pyupgrade, django-upgrade and djhtml before commits. (execute +`pre-commit install` to install the git hook.) Tests