Skip to content

Commit 4c6f681

Browse files
committed
build: remove husky and validation hooks
Previously, we relied on husky package to set up the Git hooks to automatically lint code and check the commit message conventions. While it is a nice feature it causes extra delays on commit/push for more experienced contributors and we still get many PRs with incorrect commit messages from the first-time contributors. Given the above reasons remove the husky dependency, Git hooks and replace them with a script which can be used locally. Note that CI continues to validate the commit message conventions as before.
1 parent a2261bb commit 4c6f681

3 files changed

Lines changed: 7 additions & 262 deletions

File tree

docs/dev/02-making-changes.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ TODO:
99

1010
If you are thinking about making Karma better, or you just want to hack on it, that’s great!
1111
Here are some tips on how to set up a Karma workspace and how to send a good pull request.
12-
**Please note we enforce [commit message conventions].**
1312

1413
## Setting up the Workspace
1514

@@ -66,11 +65,15 @@ change the code, run the tests, etc.
6665

6766
## Sending a Pull Request
6867

69-
- Commit your changes (**please follow our [commit message conventions]**):
68+
- Commit your changes (please follow [commit message conventions]):
7069
```bash
7170
$ git commit -m "..."
7271
```
73-
- Push to your github repo:
72+
- Verify that the last commit follows the conventions:
73+
```bash
74+
$ npm run commit:check
75+
```
76+
- Push to your GitHub repo:
7477
```bash
7578
$ git push origin <branch_name>
7679
```

package-lock.json

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

package.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,6 @@
460460
"eslint-plugin-promise": "^4.2.1",
461461
"eslint-plugin-standard": "^4.0.1",
462462
"http2": "^3.3.6",
463-
"husky": "^4.2.5",
464463
"jasmine-core": "^3.6.0",
465464
"karma": ".",
466465
"karma-browserify": "^7.0.0",
@@ -495,15 +494,10 @@
495494
},
496495
"version": "6.3.7",
497496
"license": "MIT",
498-
"husky": {
499-
"hooks": {
500-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
501-
"pre-commit": "npm run lint"
502-
}
503-
},
504497
"scripts": {
505498
"lint": "eslint . --ext js --ignore-pattern *.tpl.js",
506499
"lint:fix": "eslint . --ext js --ignore-pattern *.tpl.js --fix",
500+
"commit:check": "commitlint --from HEAD~1",
507501
"test:unit": "mocha \"test/unit/**/*.spec.js\"",
508502
"test:e2e": "cucumber-js test/e2e/*.feature",
509503
"test:client": "node bin/karma start test/client/karma.conf.js",

0 commit comments

Comments
 (0)