-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlefthook.yml
More file actions
53 lines (43 loc) · 1.37 KB
/
lefthook.yml
File metadata and controls
53 lines (43 loc) · 1.37 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
# Lefthook Git Hooks Configuration
# https://lefthook.dev/configuration/
# Auto-fix formatting and linting issues before commit
pre-commit:
skip:
- ref: main
env:
- CI
commands:
format:
glob: "*.{ts,js,tsx,jsx,svelte}"
run: npx biome check --write --unsafe {staged_files}
stage_fixed: true
fail_text: |
❌ Formatting/linting failed!
Could not fix issues in staged files. Please check the error above and fix manually.
# Check formatting before push
pre-push:
commands:
format-check:
run: npx biome ci --diagnostic-level=error .
fail_text: |
❌ Format check failed!
Your code has formatting issues. Run `npm run format` to fix them.
# Validate commit messages using commitlint
commit-msg:
skip:
- ref: main
env:
- CI
commands:
commitlint:
run: npx commitlint --edit {1}
fail_text: |
❌ Commit message validation failed!
Your commit message doesn't follow the Conventional Commits specification.
Format: <type>(<scope>): <subject>
Valid types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
Examples:
feat: add new Button variant
fix: resolve Card styling issue
docs: update component documentation
For more info: https://www.conventionalcommits.org/