Skip to content

Commit a2e2e7d

Browse files
committed
Use pre-commit CI over extra deps
1 parent 4ec78b2 commit a2e2e7d

File tree

5 files changed

+53
-46
lines changed

5 files changed

+53
-46
lines changed

.bandit

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,10 @@
11
name: CI
2-
32
on:
43
push:
54
branches:
65
- master
76
pull_request:
8-
97
jobs:
10-
11-
lint:
12-
strategy:
13-
fail-fast: false
14-
matrix:
15-
lint-command:
16-
- ruff format --check .
17-
- ruff check --output-format=github .
18-
- django-upgrade --check `git ls-files | grep .py`
19-
- pyupgrade `git ls-files | grep .py`
20-
runs-on: ubuntu-latest
21-
steps:
22-
- uses: actions/checkout@v5
23-
- uses: actions/setup-python@v6
24-
with:
25-
python-version: "3.x"
26-
cache: pip
27-
cache-dependency-path: pyproject.toml
28-
- run: python -m pip install .[lint]
29-
- run: ${{ matrix.lint-command }}
30-
318
dist:
329
runs-on: ubuntu-latest
3310
steps:
@@ -42,7 +19,6 @@ jobs:
4219
- uses: actions/upload-artifact@v5
4320
with:
4421
path: dist/*
45-
4622
docs:
4723
runs-on: ubuntu-latest
4824
steps:
@@ -54,9 +30,8 @@ jobs:
5430
- run: python -m pip install sphinxcontrib-spelling
5531
- run: python -m pip install -e '.[docs]'
5632
- run: python -m sphinx -W -b spelling docs docs/_build
57-
5833
SQLite:
59-
needs: [ lint, dist, docs ]
34+
needs: [dist, docs]
6035
runs-on: ubuntu-latest
6136
strategy:
6237
matrix:
@@ -81,13 +56,12 @@ jobs:
8156
with:
8257
token: ${{ secrets.CODECOV_TOKEN }}
8358
flags: python-${{ matrix.python-version }}
84-
8559
wagtail:
86-
needs: [ lint, dist, docs ]
60+
needs: [dist, docs]
8761
runs-on: ubuntu-latest
8862
strategy:
8963
matrix:
90-
python-version: [ "3.x" ]
64+
python-version: ["3.x"]
9165
wagtail-version:
9266
- "6.3.0"
9367
- "7.0.0"
@@ -105,14 +79,12 @@ jobs:
10579
with:
10680
token: ${{ secrets.CODECOV_TOKEN }}
10781
flags: ${{ matrix.extras }}
108-
109-
11082
PostgreSQL:
111-
needs: [ lint, dist, docs ]
83+
needs: [dist, docs]
11284
runs-on: ubuntu-latest
11385
strategy:
11486
matrix:
115-
python-version: [ "3.x" ]
87+
python-version: ["3.x"]
11688
services:
11789
postgres:
11890
image: postgres

.pre-commit-config.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: check-merge-conflict
7+
- id: check-ast
8+
- id: check-toml
9+
- id: check-yaml
10+
- id: check-symlinks
11+
- id: debug-statements
12+
- id: end-of-file-fixer
13+
exclude: "mailauth/templates/registration/login_subject.txt"
14+
- id: no-commit-to-branch
15+
args: [--branch, main]
16+
- repo: https://github.com/asottile/pyupgrade
17+
rev: v3.20.0
18+
hooks:
19+
- id: pyupgrade
20+
- repo: https://github.com/adamchainz/django-upgrade
21+
rev: 1.29.0
22+
hooks:
23+
- id: django-upgrade
24+
- repo: https://github.com/hukkin/mdformat
25+
rev: 0.7.22
26+
hooks:
27+
- id: mdformat
28+
additional_dependencies:
29+
- mdformat-ruff
30+
- mdformat-deflist
31+
- mdformat-footnote
32+
- mdformat-gfm
33+
- mdformat-gfm-alerts
34+
- mdformat-tables
35+
- repo: https://github.com/astral-sh/ruff-pre-commit
36+
rev: v0.13.3
37+
hooks:
38+
- id: ruff-check
39+
args: [--fix, --exit-non-zero-on-fix]
40+
- id: ruff-format
41+
- repo: https://github.com/google/yamlfmt
42+
rev: v0.19.0
43+
hooks:
44+
- id: yamlfmt
45+
ci:
46+
autoupdate_schedule: weekly
47+
skip:
48+
- no-commit-to-branch

MANIFEST.in

Lines changed: 0 additions & 6 deletions
This file was deleted.

pyproject.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,6 @@ test = [
5252
"pytest-cov",
5353
"pytest-django",
5454
]
55-
lint = [
56-
"ruff==0.14.2",
57-
"pyupgrade==3.21.0",
58-
"django-upgrade==1.29.1",
59-
]
6055
docs = [
6156
"sphinx",
6257
]

0 commit comments

Comments
 (0)