From 9561a7e7d8e3437b8ccf8a84ff7d9a300477c77d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Clgen=20Sar=C4=B1kavak?= Date: Mon, 7 Feb 2022 17:37:56 +0300 Subject: [PATCH] Add pyupgrade - django-upgrade checks --- .github/workflows/upgrade.yml | 29 +++++++++++++++++++++++++++++ .pre-commit-config.yaml | 12 ++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 .github/workflows/upgrade.yml create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/upgrade.yml b/.github/workflows/upgrade.yml new file mode 100644 index 0000000..25d8bcf --- /dev/null +++ b/.github/workflows/upgrade.yml @@ -0,0 +1,29 @@ +# https://github.com/pre-commit/action + +name: "upgrade the code" + +on: + push: + branches: + - master + pull_request: ~ + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.4.0 + name: Checkout + + - uses: actions/setup-python@v2.3.1 + name: Install Python + + - uses: pre-commit/action@v2.0.3 + name: pyupgrade (3.7) + with: + extra_args: pyupgrade --all-files + + - uses: pre-commit/action@v2.0.3 + name: django-upgrade (2.2) + with: + extra_args: django-upgrade --all-files diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..1f3f5c9 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,12 @@ +repos: +- repo: https://github.com/asottile/pyupgrade + rev: v2.31.0 + hooks: + - id: pyupgrade + args: [--py37-plus] + +- repo: https://github.com/adamchainz/django-upgrade + rev: 1.4.0 + hooks: + - id: django-upgrade + args: [--target-version, "2.2"]