From 65601dedd04543d2b4c0663b273ade803f1b1712 Mon Sep 17 00:00:00 2001 From: Valentin Deniaud Date: Mon, 3 Oct 2022 14:28:00 +0200 Subject: [PATCH] misc: add django-upgrade files/notes (#69798) --- .git-blame-ignore-revs | 2 ++ .pre-commit-config.yaml | 15 ++++++++++----- README | 9 ++++++--- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 91cddd8..ff7039d 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,2 +1,4 @@ # misc: apply djhtml (#69422) 7172e86b103ba2d2c4a0fd5623f21b5c7e6db0ce +# misc: apply django-upgrade (#69798) +3b0c9bb02c62b30127051fc33c22e2f325c151b7 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ef94dad..030c42f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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: diff --git a/README b/README index 645913d..9743811 100644 --- a/README +++ b/README @@ -23,9 +23,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