Closed djantea closed 4 years ago
This sounds very exciting! I will have some time to look at this this evening. This is a big contribution, I’m really looking forward to having this functionality.
Sorry, I've been crazy busy lately. This isn't off my radar :D
I have pushed to https://github.com/djantea/git_ops/tree/comm_msg_validation the test cases for the new introduced mix tasks: git_ops.check_message
and git_ops.message_hook
(renamed it from mix git_ops.msg_hook
).
Sorry, I've been crazy busy lately. This isn't off my radar :D
That is fine. Please let me know if you prefer to create the pull request and review from there, or review now from https://github.com/djantea/git_ops/tree/comm_msg_validation and create the pull request after. Thanks.
I've looked over the bulk of the changes, but haven't had a time to do a line-by-line review. However, it looks like an awesome change. Go ahead and make the PR, and I'll do some more in-depth review and get it merged.
Go ahead and make the PR
Done
This can be closed via #25
Hi,
This is probably related to the Roadmap point "Validation of commits".
I started to work on a mechanism to automatically validate the Git commit message by using a
commit-msg
git hook. It uses two mix tasks:mix git_ops.check_message
- receives the path to a commit message and validates if it follows the Conventional Commits spec using the existing parser in the project;mix git_ops.msg_hook
- install / uninstall a Gitcommit-msg
hook that calls the above task. It does nothing if the hook already exists. Some inspiration drown from here: https://github.com/qgadrian/elixir_git_hooksI have pushed these in the following branch: https://github.com/djantea/git_ops/tree/comm_msg_validation
The reasons I have not created the pull request are:
Something that could be part of a subsequent pull request:
mix git_ops.msg_hook
when compiling the project that includesgit_ops
as a dependency, as a way to share the commit message validation mechanism with the team working on the project.