-
Notifications
You must be signed in to change notification settings - Fork 2
chore(script): check message during commit #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this makes sense only as a commit-msg
hook, not a pre-commit one.
I doubt the hook configuration itself works as-is, given that AFAIK pre-commit
passes files to hooks, not commit SHAs
a72f755
to
4881008
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments
@@ -242,6 +242,23 @@ jobs: | |||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |||
``` | |||
|
|||
## Add pre-commit plugin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I try it on the repo itself with this branch as rev, but I wasn't able to make it work :(
Also I got some linting errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the readme, maybe this is the step mising in you test :
https://github.com/lumapps/commit-message-validator/blame/chore/precommit_hook/README.md#L266
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually without --hook-type commit-msg
it can't work. I fixed the docs
- Add script that checks message from file - Add precommit hook to help python developers make goo commit messages
4881008
to
af32da8
Compare
fbd6c0b
to
849fd0e
Compare
I'm finally keeping the |
And as discussed with @sebastien-boulle we might depreciate this in favor of a different approach:
But in the mean time let's keeps this, as I'm short in time right now to do all that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not much to say otherwise
check_message.sh
Outdated
|
||
fi | ||
|
||
# print message so you don't loose it in case of errors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lose*
check_message.sh
Outdated
# (in case you are not using `-m` option) | ||
printf "checking commit message:\n\n#BEGIN#\n%s\n#END#\n\n" "$(grep -v "#" <<< "$MESSAGE")" | ||
|
||
COMMIT_VALIDATOR_ALLOW_TEMP=1 COMMIT_VALIDATOR_NO_JIRA=1 validate "$MESSAGE" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope you don't want to deactivate JIRA validation
Now we can fixup locally. The github action should still block the merge though
adding the configuration necesarry to run the validator during
5eec7f2
to
3103930
Compare
3103930
to
5693e98
Compare
using validator on its own repo
5693e98
to
d0de179
Compare
Uh oh!
There was an error while loading. Please reload this page.