Skip to content

Commit 68b454c

Browse files
committed
build: fix hooks verification
1 parent 755c659 commit 68b454c

5 files changed

Lines changed: 1501 additions & 16 deletions

File tree

.prettierignore

Whitespace-only changes.

commitlint.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default {
2+
extends: ["@commitlint/config-angular"],
3+
};

lefthook.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pre-commit:
88
# Format code with oxfmt
99
oxfmt:
1010
glob: "*.{js,ts,jsx,tsx,json,yaml,yml,md}"
11-
run: pnpm exec oxfmt {staged_files}
11+
run: pnpm oxfmt {staged_files}
1212
stage_fixed: true
1313

1414
buildifier-format:
@@ -20,13 +20,13 @@ pre-commit:
2020
stage_fixed: true
2121

2222
# Check for typos
23-
typos:
24-
run: |
25-
if command -v typos &> /dev/null; then
26-
typos
27-
else
28-
echo "typos not installed, skipping"
29-
fi
23+
cspell:
24+
run: pnpm cspell lint --no-progress --no-summary {staged_files}
25+
exclude:
26+
- pnpm-lock.yaml
27+
- "*.lock"
28+
- lefthook.yml
29+
- package.json
3030

3131
# Note: The following pre-commit hooks are not available in lefthook or were removed:
3232
# - check-hooks-apply (meta hook, lefthook-specific)
@@ -43,11 +43,6 @@ pre-commit:
4343

4444
commit-msg:
4545
commands:
46-
# Commit message validation with commitizen
47-
commitizen:
48-
run: |
49-
if command -v cz &> /dev/null; then
50-
cz check --commit-msg-file {1}
51-
else
52-
echo "commitizen not installed, skipping commit message validation"
53-
fi
46+
# Commit message validation with commitlint
47+
commitlint:
48+
run: pnpm commitlint --edit {1}

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
"prepare": "lefthook install"
77
},
88
"devDependencies": {
9+
"@commitlint/cli": "^20.3.0",
10+
"@commitlint/config-angular": "^20.3.0",
911
"@evilmartians/lefthook": "^2.0.0",
12+
"cspell": "^9.4.0",
1013
"oxfmt": "^0.22.0"
1114
},
1215
"packageManager": "pnpm@10.27.0"

0 commit comments

Comments
 (0)