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"]