You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: public/drafts/commit-to-contribute.md
+13-9Lines changed: 13 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,19 +68,23 @@ For context: [semantic release](https://www.npmjs.org/semantic-release) will rea
68
68
69
69
I've been using semantic release in all of my projects, and so long as the commit message format is right, then there's no work involved in creating release, and importantly there's no work in deciding *what* the version is going to be.
70
70
71
-
Something that none of my repos do today is to validate contributed commits for formatting. In reality semantic release doesn't mind if you don't follow the commit format, but they're simply ignored and don't drive releases (to npm).
71
+
Something that historically none of my repos had was the ability tovalidate contributed commits for formatting. In reality semantic release doesn't mind if you don't follow the commit format, but they're simply ignored and don't drive releases (to npm).
72
72
73
-
However, I've recently come across tools like [ghook](https://www.npmjs.com/package/ghooks) that will run commands on git hooks, and in particular using a `commit-msg` hook that could run [validate-commit-message](https://www.npmjs.com/package/validate-commit-message). The installation is relatively straight forward, but my concern is the warning response from the terminal:
73
+
I've since come across [ghooks](https://www.npmjs.com/package/ghooks) that will run commands on git hooks, and in particular using a `commit-msg` hook that could run [validate-commit-msg](https://www.npmjs.com/package/validate-commit-msg). The installation is relatively straight forward, but the reward back to the user is really good, because I say that the commit needs tweaking, can include examples and I can include links.
74
74
75
-
```nohighlight
76
-
❯ git commit -m'add the things'
77
-
INVALID COMMIT MSG: does not match "<type>(<scope>): <subject>" !
...and in the GitHub desktop app (for comparison):
80
+
81
+

82
+
83
+
This is work that I can load on myself to make contributing easier, which in turn, makes my job easier when it comes to managing and merging contributions into the project. In addition, for my projects, I'm also adding a `pre-push` hook that runs all the tests before the push to GitHub is allowed. That way it means if new code has broken the tests, the author is aware.
80
84
81
-
Being able to customise this message on a per projet basis would be ideal. Rather than notifying the author that they've done something wrong, I'd rather point them in the direction of how to make the commit work.
85
+
To see the changes required to get the output above, see [this commit](https://github.com/remy/clite/commit/fc36b01005fb37fc1a16079d4ab3ca5bd5e4450d)in my current tinker project.
82
86
83
-
The question that drives the automatic checks and notices is: how, **with no extra work on the contributors' side**, do we make this work?
87
+
Two further areas worth investigating are the [commitizen](https://www.npmjs.com/package/commitizen) project, and what I'd *really* like to see is a GitHub bot that could automatically comment on pull requests that say whether the commits are okay (and if not, direct the contributor on how to fix that problem) and also show how the PR would affect the release (i.e. whether it would trigger a release or not, whether a bug patch or a minor version change).
0 commit comments