-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
93 lines (86 loc) · 2.85 KB
/
.pre-commit-config.yaml
File metadata and controls
93 lines (86 loc) · 2.85 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
default_stages: [pre-commit]
repos:
- repo: local
hooks:
- id: protect-main-branch
name: Protect main branch
entry: bazel/tools/git/protect-main.sh
language: script
always_run: true
pass_filenames: false
# Fast format - same formatters as CI, scoped to staged files
- id: format-code
name: Format code
entry: bazel/tools/format/fast-format.sh --staged
language: script
always_run: true
pass_filenames: false
# Lock file updates - only when source files change
- id: update-python-requirements
name: Update Python requirements
entry: bazel/tools/format/update-python-requirements-if-needed.sh
language: script
files: 'pyproject\.toml$'
pass_filenames: false
- id: update-apko-locks
name: Update apko locks
entry: bazel/tools/format/update-apko-locks.sh
language: script
files: 'apko\.yaml$'
pass_filenames: false
- id: update-atlas-sum
name: Update Atlas migration checksums
entry: bazel/tools/format/update-atlas-sum.sh
language: script
files: 'migrations/.*\.sql$'
pass_filenames: false
# Run format after rebase to catch formatting drift
# Install with: pre-commit install --hook-type post-rewrite
- id: post-rewrite-format
name: Format after rebase
entry: bazel/tools/git/post-rewrite-format.sh
language: script
always_run: true
pass_filenames: false
stages: [post-rewrite]
- repo: local
hooks:
# Reject non-ASCII characters in the commit title (first line).
# Wrangler Pages fails with error 8000111 when the commit subject
# contains non-ASCII (smart quotes, em-dashes, arrows, etc.).
# Only the title is checked; the body is unrestricted.
# Install with: pre-commit install --hook-type commit-msg
- id: ascii-commit-msg
name: Reject non-ASCII characters in commit title
entry: bazel/tools/git/check-commit-msg-ascii.sh
language: script
stages: [commit-msg]
always_run: true
pass_filenames: true # pre-commit passes the commit-msg file path
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v4.4.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args:
- feat
- fix
- docs
- style
- refactor
- perf
- test
- build
- ci
- chore
- revert
- repo: https://github.com/semgrep/pre-commit
rev: v1.153.1
hooks:
- id: semgrep
args: ["--config", "bazel/semgrep/rules/", "--error"]
exclude: "^bazel/semgrep/rules/"
- repo: https://github.com/gitleaks/gitleaks
rev: v8.24.2
hooks:
- id: gitleaks