-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
155 lines (155 loc) · 4.58 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
ci:
autoupdate_branch: 'main'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: detect-private-key
name: 'Detect private keys'
- id: check-merge-conflict
name: 'Check for merge conflicts'
- id: trailing-whitespace
name: 'Trim trailing whitespaces'
- id: mixed-line-ending
name: 'Replace mixed line endings'
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.31.1
hooks:
- id: check-github-workflows
- id: check-renovate
- repo: local
hooks:
- id: sync-additional-dependencies
name: 'Sync additional_dependencies'
entry: python .pre-commit/sync-additional-dependencies.py
language: python
files: (^.pre-commit/)|(package.json$)
additional_dependencies:
- pyyaml==6.0.1
- repo: https://github.com/python-poetry/poetry
rev: 2.1.1
hooks:
- id: poetry-check
name: 'Check Poetry config and verify that lockfile is consistent with pyproject.toml'
args: [-C, ./backend, --lock]
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
hooks:
- id: pyupgrade
name: 'Upgrade Python syntax to newer versions'
args: [--py313-plus]
- repo: https://github.com/adamchainz/django-upgrade
rev: 1.23.1
hooks:
- id: django-upgrade
name: 'Upgrade Django syntax to newer versions'
args: [--target-version, '5.1']
- repo: https://github.com/hadialqattan/pycln
rev: v2.5.0
hooks:
- id: pycln
name: 'Remove unused Python imports'
- repo: https://github.com/PyCQA/isort
rev: 6.0.0
hooks:
- id: isort
name: 'Sort Python imports'
args: [--settings, ./backend/pyproject.toml]
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.1.0
hooks:
- id: black
name: 'Format Python code'
- repo: https://github.com/rtts/djhtml
rev: 3.0.7
hooks:
- id: djhtml
name: 'Format Django templates'
files: ^backend/templates/
- repo: https://github.com/PyCQA/flake8
rev: 7.1.2
hooks:
- id: flake8
name: 'Lint Python code'
args: [--toml-config=./backend/pyproject.toml]
additional_dependencies:
- Flake8-pyproject
- repo: https://github.com/PyCQA/bandit
rev: 1.8.3
hooks:
- id: bandit
name: 'Check Python security issues'
exclude: ^backend/tests/
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.5.1
hooks:
- id: prettier
name: 'Format JavaScript and TypeScript code'
exclude: (^backend/templates/)|((poetry\.lock|package(-lock)?\.json)$)
exclude_types:
- python
args: [--config, ./frontend/.prettierrc]
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v9.20.1
hooks:
- id: eslint
name: 'Lint JavaScript code (Frontend)'
files: ^frontend/
types:
- text
types_or:
- javascript
- jsx
args:
[
--config,
./frontend/.eslintrc.cjs,
--ignore-path,
./frontend/.eslintignore,
--rule,
'import/no-unresolved: off',
--fix,
]
additional_dependencies:
- eslint-config-airbnb@19.0.4
- eslint-config-prettier@10.0.1
- eslint-plugin-import@2.31.0
- eslint-plugin-jsx-a11y@6.10.2
- eslint-plugin-prettier@5.2.3
- eslint-plugin-react-hooks@4.6.2
- eslint-plugin-react@7.37.4
- eslint@8.57.1
- prettier@3.5.1
- id: eslint
name: 'Lint TypeScript code (Admin dashboard)'
files: ^frontend-admin/
types:
- text
types_or:
- javascript
- jsx
- ts
- tsx
args: [
--config,
./frontend-admin/eslint.config.cjs,
--rule,
'import/no-unresolved:
off',
--fix,
]
additional_dependencies:
- '@eslint/compat@1.2.6'
- '@eslint/js@9.20.0'
- '@tanstack/eslint-plugin-query@5.66.1'
- eslint-config-prettier@10.0.1
- eslint-import-resolver-typescript@3.8.1
- eslint-plugin-import@2.31.0
- eslint-plugin-prettier@5.2.3
- eslint-plugin-react-hooks@5.1.0
- eslint-plugin-react@7.37.4
- eslint@9.20.1
- globals@15.15.0
- prettier@3.5.1
- typescript-eslint@8.24.1
- typescript@5.7.3