-
Notifications
You must be signed in to change notification settings - Fork 4
/
.pre-commit-config.yaml
48 lines (42 loc) · 1.41 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# see docs/python-linting.md for more details
default_stages: [commit]
default_language_version:
python: python3.11
repos:
# Note that all of the `local` repo hooks are version managed by
# poetry. This is done to ensure that the same versions are used locally
# as in CI. Update them via poetry when needed.
- repo: local
hooks:
# Ensure poetry installed package versions are up-to-date with lockfile
- id: poetry-install
entry: poetry lock --check
language: system
name: poetry - Python package installation
pass_filenames: false
types_or: [python, html]
# Django template formatting - will amend files
- id: djhtml
entry: poetry run djhtml
language: system
name: djhtml - Django template formatting
types: [html]
files: ./templates/.*\.html$
# python code formatting - will amend files
- id: black
entry: poetry run black
language: system
name: black - Python code formatting
types: [python]
# python code linting
- id: ruff
entry: poetry run ruff --fix perimeter
language: system
name: ruff - Python code linting
types: [python]
# python static type checking
- id: mypy
entry: poetry run mypy
language: system
name: mypy - Python type checking
types: [python]