-
Notifications
You must be signed in to change notification settings - Fork 696
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
87 lines (81 loc) · 2.91 KB
/
.pre-commit-config.yaml
File metadata and controls
87 lines (81 loc) · 2.91 KB
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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
# General file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: ^frontend/
- id: end-of-file-fixer
exclude: ^frontend/
- id: check-yaml
args: ['--unsafe']
- id: check-added-large-files
args: ['--maxkb=5000']
- id: check-merge-conflict
- id: check-case-conflict
- id: mixed-line-ending
args: ['--fix=lf']
# Python Backend - Black formatter
- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black
name: Format Python code with Black
files: ^backend/
args: ['--line-length=100']
language_version: python3
# Python Backend - isort import sorter
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: Sort Python imports with isort
files: ^backend/
args: ['--profile=black', '--line-length=100']
# Python Backend - flake8 linter
- repo: https://github.com/pycqa/flake8
rev: 7.1.1
hooks:
- id: flake8
name: Lint Python code with flake8
files: ^backend/
exclude: ^backend/(alembic|run_alembic\.py|migrate_data\.py|verify_data\.py|tests/)
args: ['--max-line-length=100', '--extend-ignore=E203,W503,E501']
# Python Backend - mypy type checker
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.0
hooks:
- id: mypy
name: Type check Python code with mypy
files: ^backend/
exclude: ^backend/(venv|\.venv|tests|htmlcov)/
args: ['--config-file=backend/pyproject.toml']
additional_dependencies:
- types-PyYAML>=6.0.0
- types-requests>=2.31.0
# JavaScript/React Frontend - ESLint
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v9.19.0
hooks:
- id: eslint
name: Lint JavaScript/React code with ESLint
files: ^frontend/.*\.(js|jsx)$
exclude: ^frontend/(e2e/|src/test/|.*\.test\.(js|jsx)$|.*\.spec\.(js|jsx)$|src/.*/(__tests__/|__mocks__/)|vitest\.config\.js$|playwright\.config\.js$|vite\.config\.js$|setup-tests\.sh$)
args: ['--fix', '--config=frontend/eslint.config.js']
additional_dependencies:
- eslint@9.19.0
- '@eslint/js@9.19.0'
- globals@15.14.0
- eslint-plugin-react@7.37.4
- eslint-plugin-react-hooks@5.0.0
- eslint-plugin-react-refresh@0.4.18
# # JavaScript/React Frontend - Prettier formatter
# - repo: https://github.com/pre-commit/mirrors-prettier
# rev: v4.0.0-alpha.8
# hooks:
# - id: prettier
# name: Format JavaScript/React code with Prettier
# files: ^frontend/.*\.(js|jsx|json|css|html)$
# args: ['--write', '--print-width=100', '--single-quote', '--trailing-comma=es5']