Skip to content

Commit dcf31d9

Browse files
committed
Add pyupgrade - django-upgrade checks
1 parent a7a8b3d commit dcf31d9

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.github/workflows/upgrade.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# https://github.com/pre-commit/action
2+
3+
name: "upgrade the code"
4+
5+
on:
6+
push:
7+
branches:
8+
- master
9+
pull_request: ~
10+
11+
jobs:
12+
check:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2.4.0
16+
name: Checkout
17+
18+
- uses: actions/setup-python@v2.3.1
19+
name: Install Python
20+
21+
- uses: pre-commit/action@v2.0.3
22+
name: pyupgrade (3.7)
23+
with:
24+
extra_args: pyupgrade --all-files
25+
26+
- uses: pre-commit/action@v2.0.3
27+
name: django-upgrade (2.2)
28+
with:
29+
extra_args: django-upgrade --all-files

pre-commit-config.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
repos:
2+
- repo: https://github.com/asottile/pyupgrade
3+
rev: v2.31.0
4+
hooks:
5+
- id: pyupgrade
6+
args: [--py37-plus]
7+
8+
- repo: https://github.com/adamchainz/django-upgrade
9+
rev: 1.4.0
10+
hooks:
11+
- id: django-upgrade
12+
args: [--target-version, "2.2"]

0 commit comments

Comments
 (0)