-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
82 lines (78 loc) · 2.22 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
default_language_version:
node: system
python: python3.12
repos:
# Python linting and formatting
- repo: https://github.com/python/black
rev: '24.2.0' # keep version in sync with pyproject.toml
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: '7.0.0' # keep version in sync with pyproject.toml
hooks:
- id: flake8
- repo: https://github.com/PyCQA/isort
rev: '5.13.2' # keep version in sync with pyproject.toml
hooks:
- id: isort
- repo: https://github.com/python-poetry/poetry
rev: '1.7.1' # keep version in sync with version installed in the Dockerfile
hooks:
- id: poetry-check
- id: poetry-lock
# Never update dependencies and only run on changes to pyproject.toml
args: [--no-update]
files: ^pyproject.toml$
# FE linting and formatting
# NB - These run locally, not in an isolated environment, and hence require
# node, npm, and node_modules to be installed. Doing it this way prevents us
# having to duplicate all of eslint plugins from package.json in this file and
# you should probably have a working toolchain to make changes to these files
# anyway, right?
- repo: local
hooks:
- id: fix:js
name: fix:js
language: system
entry: npm run fix:js
types_or:
- javascript
- ts
- tsx
- id: fix:css
name: fix:css
language: system
entry: npm run fix:css
types_or:
- css
- scss
- id: fix:format
name: fix:format
language: system
entry: npm run fix:format
types_or:
- markdown
- css
- scss
- javascript
- ts
- tsx
- json
- yaml
# Template linting
- repo: https://github.com/rtts/djhtml
rev: 3.0.6
hooks:
- id: djhtml
# Misc. other linters
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0 # keep version in sync with pyproject.toml
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
exclude: >
(?x)^(
.*/tests/.*|
package-lock.json|
poetry.lock
)$