add pre-commit

This commit is contained in:
FuzzyGrim
2026-01-27 20:47:18 +01:00
parent 7fadd981f8
commit 688dbc1a20
4 changed files with 18 additions and 1 deletions

15
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,15 @@
repos:
- repo: local
hooks:
- id: ruff
name: ruff
entry: ruff check --fix
language: system
types: [python]
require_serial: true
- id: ruff-format
name: ruff-format
entry: ruff format
language: system
types: [python]
require_serial: true

View File

@@ -118,6 +118,7 @@ Then run the following commands.
```bash
python -m pip install -U -r requirements-dev.txt
pre-commit install
cd src
python manage.py migrate
python manage.py runserver & celery -A config worker --beat --scheduler django --loglevel DEBUG & tailwindcss -i ./static/css/input.css -o ./static/css/tailwind.css --watch

View File

@@ -4,7 +4,7 @@ extend-exclude = ["migrations"]
[tool.ruff.lint]
select = ["ALL"]
ignore = ["ANN", "PT", "PD", "D100", "D104", "RUF012", "PLR0913", "SLF001"]
ignore = ["ANN", "PT", "PD", "D100", "D104", "RUF012", "PLR0913", "SLF001", "COM812"]
[tool.ruff.lint.pycodestyle]
max-doc-length = 88

View File

@@ -1,6 +1,7 @@
coverage==7.13.0
djlint==1.36.4
fakeredis==2.33.0
pre-commit==4.5.1
pytest-django==4.11.1
pytest-playwright==0.7.2
ruff==0.14.10