Make first-time encounters easier for contributors
marionebl opened this issue · comments
First time contributors of projects using commitlint
run into our checks unprepared.
This increases friction at a point critical for every OSS project, up to the point where commit messages are lost:
- remy/nodemon#1110 (comment)
- googleapis/cloud-trace-nodejs#543
- google/gts#8
- uPortal-Attic/uportal-app-framework#535
We should do more to make contributing as easy as possible when commitlint
is used
-
@commitlint/template
. Will prepend commit messages with example messages generated from our config. Idea snatched from remy/nodemon#1110 (comment), example: lennym/commit-template. This introduces a secondhusky
commit hook, increasing install complexity. Decide ifcommitlint init
should set this when implemented: https://github.com/marionebl/commitlint/issues/48 -
commitlint restore
: Let users restore commit messages that failed the tests for repeated edits. Theoretically we could even create apreparecommitmsg
hook to read that from an agreed-upon place? -
commitlintbot: Support commitlintbot to become the go-to tool for projects opting for linting on PR/Squashing level only. This approach moves the burden of commit conventions to project maintainers entirely.
An official GitHub integration (like commitlintbot) would be the most valuable IMO. ⭐
Reading through CI logs to look for what when wrong in the commit format is not an optimal user experience.
commitlint restore
and @commitlint/template
both sound like nice improvements as well. 👍
as mentioned at HH.js yesterday: one way could use a .git-commit-template.txt
Unfortunately I don't know a way to do it on repository level, so a user has to enable it manually
with git config commit.template ~/.git-commit-template.txt
(or git config --global commit.template ~/.git-commit-template.txt
) to specify a path
Here is a example for a .git-commit-template.txt
: https://gist.github.com/Linell/bd8100c4e04348c7966d
👍 for commitlintbot and squashing. The pull request level is the right place to deal with this. To me, it's the maintainer's job to groom the PR so that it fits in to the upstream repo.
Any news about commitlint restore
? Is (how?) it possible to configure such a functionality at the moment?