-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
101 lines (90 loc) · 2.51 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
101 lines (90 loc) · 2.51 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
repos:
# Simple file checks first (fast and catch basic issues)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-added-large-files
- id: debug-statements
language_version: python3
- id: check-merge-conflict
- id: detect-private-key
- id: check-ast
- id: check-toml
# Code formatting (fix formatting before running linters)
- repo: https://github.com/psf/black
rev: 25.1.0
hooks:
- id: black
args: [--safe, --line-length=79]
- repo: https://github.com/PyCQA/isort
rev: 6.0.1
hooks:
- id: isort
args: [--profile=black]
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
hooks:
- id: pyupgrade
args: [--py36-plus]
- repo: https://github.com/hadialqattan/pycln
rev: v2.5.0
hooks:
- id: pycln
args: [--config=pyproject.toml]
# Linters (analyze code quality)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.10
hooks:
- id: ruff
args: ["--fix", "--verbose", "--extend-exclude=tests"]
- repo: https://github.com/PyCQA/flake8
rev: 7.1.2
hooks:
- id: flake8
language_version: python3
args: ["--ignore=E203,E501,W503"]
- repo: https://github.com/PyCQA/pylint
rev: v3.3.5
hooks:
- id: pylint
args: ["--disable=W0613,C0103,E0401,W0212,W0621"]
exclude: ^(tests|frontend)/
# Security checks
- repo: https://github.com/PyCQA/bandit
rev: 1.8.3
hooks:
- id: bandit
args: ["--format", "screen", "--quiet", "-s", "B101,B113"]
additional_dependencies:
- bandit
- repo: https://github.com/gitleaks/gitleaks
rev: v8.24.0
hooks:
- id: gitleaks
# Type checking (more intensive)
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.15.0
hooks:
- id: mypy
files: ./
exclude: ^(tests|frontend)/
args: [--strict, --ignore-missing-imports, --explicit-package-bases]
additional_dependencies:
- fastapi
- types-PyYAML
- pydantic-settings
- types-requests
- SQLAlchemy>=2.0
# Documentation checks
- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
args: ["--convention=google"]
exclude: ^(frontend/|tests/)
additional_dependencies:
- tomli