Repository navigation
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
71 lines (66 loc) · 2.29 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
71 lines (66 loc) · 2.29 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
# Pre-commit hooks for deepwiki-open (Next.js frontend + FastAPI backend)
#
# Setup:
# pipx install pre-commit # or: pip install pre-commit
# pre-commit install # install the git hook
# pre-commit run --all-files # run once across the whole repo
#
# Update pinned versions later with: pre-commit autoupdate
default_language_version:
python: python3.12
# Never touch generated / vendored / log / backup files.
exclude: |
(?x)^(
.*\.bak|
api/logs/.*|
.*/__pycache__/.*|
public/.*\.svg|
yarn\.lock|
package-lock\.json|
uv\.lock|
api/poetry\.lock
)$
repos:
# ---------------------------------------------------------------------------
# General hygiene
# ---------------------------------------------------------------------------
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix=lf]
- id: check-merge-conflict
- id: check-case-conflict
- id: check-added-large-files
args: [--maxkb=1024]
- id: check-yaml
- id: check-toml
- id: check-json
# .vscode/*.json and tsconfig.json are JSONC (allow comments) -> skip
exclude: ^(\.vscode/|tsconfig\.json$)
- id: detect-private-key
# ---------------------------------------------------------------------------
# Secret scanning
# Blocks commits that contain tokens, keys, or credentials.
# ---------------------------------------------------------------------------
- repo: https://github.com/gitleaks/gitleaks
rev: v8.21.2
hooks:
- id: gitleaks
# ---------------------------------------------------------------------------
# Python — ruff replaces flake8 + isort + black (lint + format in one tool).
# Scoped to the backend and test dirs only.
# ---------------------------------------------------------------------------
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
hooks:
- id: ruff
name: ruff (lint + autofix)
args: [--fix]
files: ^(api|test)/.*\.py$ # disable tests folders for now
- id: ruff-format
name: ruff (format)
files: ^(api|test)/.*\.py$