File tree 4 files changed +41
-6
lines changed 4 files changed +41
-6
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # Because commits are hard to remove (unless you are a pro at interactive
3
+ # rebasing), this commit hook script should make it easier for new
4
+ # contributors.
5
+
6
+ commit_msg=$1
7
+ cat " $commit_msg " | npm run changelog-lint-from-stdin --silent
8
+ exit_status=$?
9
+
10
+ if [ $exit_status -ne 0 ]; then
11
+ echo
12
+ echo " Your unsaved commit message:"
13
+ echo
14
+ cat " $commit_msg "
15
+ echo
16
+ echo " --------------------------------------------------------------------"
17
+ echo " Your commit was not saved because the message was formatted incorrectly."
18
+ echo " See the error log above."
19
+ echo " --------------------------------------------------------------------"
20
+ echo
21
+ echo " For formatting instructions, see:"
22
+ echo " https://github.com/mozilla/web-ext/blob/master/CONTRIBUTING.md#writing-commit-messages"
23
+ echo
24
+ echo " To bypass this check and commit anyway, use:"
25
+ echo " git commit --no-verify ..."
26
+ echo
27
+ fi
28
+
29
+ exit $exit_status
Original file line number Diff line number Diff line change @@ -141,12 +141,16 @@ Examples:
141
141
If you want to use scopes then it would look more like:
142
142
` feat(dysfunctioner): Added --quiet option ` .
143
143
144
- ### Check for commit message lint
144
+ ### Checking commit message formatting
145
145
146
- You can test that your commit message is formatted in a way that will support
147
- our changelog generator like this:
146
+ Because editing git history is difficult for many developers,
147
+ the commit message formatting described above is automatically enforced
148
+ each time you commit to your work branch.
148
149
149
- npm run changelog-lint
150
+ ** If you're on Windows** , the commit message verification currently doesn't
151
+ work (sorry!). You will need to commit to your branch using this command:
152
+
153
+ git commit --no-verify
150
154
151
155
## Squashing commits
152
156
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ Mozilla Public License Version 2.0
35
35
means any form of the work other than Source Code Form.
36
36
37
37
1.7. "Larger Work"
38
- means a work that combines Covered Software with other material, in
38
+ means a work that combines Covered Software with other material, in
39
39
a separate file or files, that is not Covered Software.
40
40
41
41
1.8. "License"
Original file line number Diff line number Diff line change 20
20
"publish-coverage" : " grunt coveralls" ,
21
21
"nsp-check" : " nsp check -o summary" ,
22
22
"changelog" : " conventional-changelog -p angular -u" ,
23
- "changelog-lint" : " conventional-changelog-lint --from master"
23
+ "changelog-lint" : " conventional-changelog-lint --from master" ,
24
+ "changelog-lint-from-stdin" : " conventional-changelog-lint"
24
25
},
25
26
"homepage" : " https://github.com/mozilla/web-ext" ,
26
27
"repository" : {
85
86
"eslint-plugin-flowtype" : " 2.19.0" ,
86
87
"firefox-client" : " 0.3.0" ,
87
88
"flow-bin" : " 0.33.0" ,
89
+ "git-hooks" : " 1.1.1" ,
88
90
"grunt" : " 1.0.1" ,
89
91
"grunt-contrib-clean" : " 1.0.0" ,
90
92
"grunt-contrib-copy" : " 1.0.0" ,
You can’t perform that action at this time.
0 commit comments