Skip to content

Commit 613b751

Browse files
committed
chore: update linter config
1 parent b6c25b6 commit 613b751

File tree

4 files changed

+42
-48
lines changed

4 files changed

+42
-48
lines changed

.github/workflows/linters.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
1-
name: Linters
1+
name: pre-commit
22

33
on:
44
pull_request:
5-
paths-ignore:
6-
- 'docs/**'
75
push:
8-
branches:
9-
- master
10-
paths-ignore:
11-
- 'docs/**'
6+
branches: [master, main]
127

138
jobs:
149
pre-commit:
1510
runs-on: ubuntu-latest
1611
steps:
17-
- uses: actions/checkout@v4
18-
- uses: actions/setup-python@v5
19-
with:
20-
python-version: '3.12'
21-
- uses: pre-commit/[email protected]
12+
- uses: actions/checkout@v4
13+
- uses: astral-sh/setup-uv@v6
14+
with:
15+
enable-cache: true
16+
- run: cp .env.example .env
17+
- uses: pre-commit/[email protected]

.github/workflows/migrations.yml

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

.pre-commit-config.yaml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
11
repos:
2-
- repo: https://github.com/charliermarsh/ruff-pre-commit
3-
rev: v0.1.13
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.14.0
44
hooks:
5-
- id: ruff
5+
- id: ruff-check
66
args: [--fix]
77
- id: ruff-format
8+
9+
- repo: https://github.com/pre-commit/pre-commit-hooks
10+
rev: v5.0.0
11+
hooks:
12+
- id: trailing-whitespace
13+
- id: end-of-file-fixer
14+
815
- repo: https://github.com/adamchainz/djade-pre-commit
9-
rev: "1.3.2"
16+
rev: "1.4.0"
1017
hooks:
1118
- id: djade
12-
args: [--target-version, "5.1"]
19+
args: [--target-version, "5.2"]
20+
21+
- repo: local
22+
hooks:
23+
- id: check-migrations
24+
name: check migrations
25+
entry: uv run manage.py makemigrations --check
26+
language: system
27+
types: [python]
28+
pass_filenames: false

pyproject.toml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,16 @@ name = "pypi"
6969
url = "https://pypi.org/simple"
7070

7171
[tool.ruff.lint]
72-
select = ["E", "F", "I"]
72+
select = [
73+
"E4", "E7", "E9", # pycodestyle errors (default from ruff)
74+
"F", # pyflakes
75+
"I", # isort
76+
"N", # naming conventions
77+
"T20", # print()
78+
"Q", # quotes
79+
"A", # overwritting builtins
80+
"LOG", # logging
81+
# TODO: the following two should get enabled once we pass
82+
#"DJ", # Django
83+
#"PTH", # use pathlib
84+
]

0 commit comments

Comments
 (0)