-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
83 lines (75 loc) · 2.67 KB
/
.pre-commit-config.yaml
File metadata and controls
83 lines (75 loc) · 2.67 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
---
# Pre-commit hooks ordered by speed - fail fast on simple issues
repos:
# 1. FASTEST: Basic file hygiene checks (milliseconds)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-merge-conflict # Super fast
- id: check-case-conflict # Filesystem check
- id: check-symlinks # Filesystem check
- id: check-added-large-files # File size check
args: [--maxkb=1000]
- id: check-yaml # Basic YAML syntax
exclude: ^k8s/
- id: check-json # Basic JSON syntax
- id: check-toml # Basic TOML syntax
- id: trailing-whitespace # Simple regex
- id: end-of-file-fixer # Simple check
- id: mixed-line-ending # Simple check
args: [--fix=lf]
# 2. FAST: Lightweight linters (seconds)
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
args: [-c=.yamllint]
- repo: https://github.com/rhysd/actionlint
rev: v1.7.7
hooks:
- id: actionlint
- repo: https://github.com/hadolint/hadolint
rev: v2.13.0-beta
hooks:
- id: hadolint-docker
# 3. MEDIUM: Formatters (fast but process more files)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.2
hooks:
- id: ruff # Linting (very fast)
args: [--fix, --exit-zero] # exit-zero: don't fail on remaining errors
- id: ruff-format # Formatting (very fast)
- repo: local
hooks:
- id: biome-format
name: biome format
entry: biome format --write --config-path react_ui
language: node
additional_dependencies: ['@biomejs/biome@2.3.14']
files: ^react_ui/.*\.(js|jsx|ts|tsx|json)$
exclude: ^react_ui/(build|node_modules|package-lock\.json)
# 4. HEAVIER: Security scanning
- repo: https://github.com/gitleaks/gitleaks
rev: v8.24.0
hooks:
- id: gitleaks
# 5. HEAVIEST: Type checking and deeper analysis
# ESLint temporarily disabled - many existing issues to fix in separate PR
# - repo: https://github.com/pre-commit/mirrors-eslint
# rev: v8.56.0
# hooks:
# - id: eslint
# files: \.(js|jsx|ts|tsx)$
# args: [--fix]
# additional_dependencies:
# - eslint@8.56.0
# - typescript@5.3.3
# - '@typescript-eslint/parser@6.21.0'
# - '@typescript-eslint/eslint-plugin@6.21.0'
# Commit message validation (only runs on commit-msg stage)
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v4.2.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: []