Skip to content

Commit 8298850

Browse files
authored
Build: Fix git hooks
Git hooks are broken since gh-512; this change fixes them by migrating to Husky as jQuery Core did. Without this fix, even `git commit --no-verify` doesn't work; only manually deleting the `.git/hooks` directory and re-running `git commit` does. Ref gh-512 Closes gh-516
1 parent 0993cd1 commit 8298850

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx commitplease .git/COMMIT_EDITMSG

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm run lint

package-lock.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"build": "node build/tasks/build-default.js",
2323
"lint": "eslint --cache .",
2424
"npmcopy": "node build/tasks/npmcopy.js",
25+
"prepare": "husky",
2526
"pretest": "npm run npmcopy && npm run build && npm run lint",
2627
"start": "npm run npmcopy && node build/tasks/build-watch.js",
2728
"test:browser": "npm run pretest && npm run test:unit -- -b chrome -b firefox -h",
@@ -47,6 +48,7 @@
4748
"express": "4.19.2",
4849
"express-body-parser-error-handler": "1.0.7",
4950
"globals": "15.3.0",
51+
"husky": "9.0.11",
5052
"native-promise-only": "0.8.1",
5153
"qunit": "2.21.0",
5254
"rollup": "4.18.0",
@@ -62,6 +64,7 @@
6264
"migrate"
6365
],
6466
"commitplease": {
67+
"nohook": true,
6568
"components": [
6669
"Docs",
6770
"Tests",

0 commit comments

Comments
 (0)