-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlefthook.yml
More file actions
39 lines (35 loc) · 1.39 KB
/
lefthook.yml
File metadata and controls
39 lines (35 loc) · 1.39 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
# See CONTRIBUTING.md for instructions.
# Lefthook configuration for git hooks
# https://github.com/evilmartians/lefthook
pre-commit:
parallel: true
commands:
# Format code with oxfmt
oxfmt:
glob: "*.{js,ts,jsx,tsx,json,yaml,yml,md}"
run: pnpm oxfmt {staged_files}
stage_fixed: true
buildifier-format:
glob: "*.{bzl,bazel,BUILD,WORKSPACE,MODULE.bazel}"
run: |
for file in {staged_files}; do
bazel run @buildifier_prebuilt//:buildifier -- --mode=fix "$PWD/$file"
done
stage_fixed: true
# Note: The following pre-commit hooks are not available in lefthook or were removed:
# - check-hooks-apply (meta hook, lefthook-specific)
# - check-useless-excludes (meta hook, lefthook-specific)
# - check-executables-have-shebangs (replaced by manual checks)
# - check-shebang-scripts-are-executable (replaced by manual checks)
# - check-toml (can be added if needed with custom command)
# - check-yaml (can be added if needed with custom command)
# - destroyed-symlinks (not commonly available)
# - detect-private-key (security check, consider using git-secrets or similar)
# - end-of-file-fixer (handled by oxfmt)
# - trailing-whitespace (handled by oxfmt)
# - commitizen (commit message validation, would need separate setup)
commit-msg:
commands:
# Commit message validation with commitlint
commitlint:
run: pnpm commitlint --edit {1}