-
Notifications
You must be signed in to change notification settings - Fork 98
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
83 lines (76 loc) · 2.98 KB
/
.pre-commit-config.yaml
File metadata and controls
83 lines (76 loc) · 2.98 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
# ── General file hygiene ──────────────────────────────────────────────
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
args: ['--allow-multiple-documents']
- id: check-added-large-files
args: ['--maxkb=1000']
- id: check-merge-conflict
- id: detect-private-key
exclude: 'components/manifests/overlays/production/github-app-secret\.yaml'
# ── Python (ruff) ────────────────────────────────────────────────────
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.12
hooks:
- id: ruff-format
files: ^(components/runners/|scripts/)
types_or: [python]
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
files: ^(components/runners/|scripts/)
types_or: [python]
# ── Go ───────────────────────────────────────────────────────────────
- repo: local
hooks:
- id: gofmt-check
name: gofmt
entry: scripts/pre-commit/gofmt-check.sh
language: script
types: [go]
pass_filenames: true
- id: go-vet
name: go vet
entry: scripts/pre-commit/go-vet.sh
language: script
types: [go]
pass_filenames: true
require_serial: true
- id: golangci-lint
name: golangci-lint
entry: scripts/pre-commit/golangci-lint.sh
language: script
types: [go]
pass_filenames: true
require_serial: true
# ── Frontend (ESLint) ────────────────────────────────────────────────
- repo: local
hooks:
- id: eslint
name: eslint
entry: scripts/pre-commit/eslint.sh
language: script
files: ^components/frontend/.*\.(ts|tsx|js|jsx)$
pass_filenames: true
# ── Branch protection ────────────────────────────────────────────────
- repo: local
hooks:
- id: branch-protection
name: branch protection
entry: python3 scripts/git-hooks/pre-commit
language: system
always_run: true
pass_filenames: false
stages: [pre-commit]
- id: push-protection
name: push protection
entry: python3 scripts/git-hooks/pre-push
language: system
always_run: true
pass_filenames: false
stages: [pre-push]