Skip to content
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

Add commit name rule #114

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Conversation

FranceBe
Copy link

Add commit-message check to respect commitizen convention on pre-commit

How to test :

  • Install commit-msg hook pre-commit install --hook-type commit-msg
  • Make any change (like delete a work in the README.md)
  • git add
  • git commit -m "wrong commit message"
  • pre-commit hook should block your commit as the commit message does not meet the commitizen convention, you should see
commit validation: failed!
please enter a commit message in the commitizen format.
commit "": "wrong commit message"
pattern: (?s)(build|ci|docs|feat|fix|perf|refactor|style|test|chore|revert|bump)(\(\S+\))?!?:( [^\n\r]+)((\n\n.*)|(\s*))?$
  • Try a commit message that respects the convention, for example git commit -m "test(pr): commit test for pr"
  • Your commit should be created correctly
  • Do not push anything of course

You're good to go to write amazing commit messages.

See the commitizen convention for reference https://www.conventionalcommits.org/en/v1.0.0/#summary
See the POS documentation that uses the same rules for reference as well https://pos-doc.alma.tech/developing/contributing/todo/contributing/#commit-name

See our best practices guide for review https://www.notion.so/almapay/Definition-of-review-3f254e05381f4ccaac895396139110a5?pvs=4#28f094431a6045bc8b0a0facddafb9de

@FranceBe FranceBe force-pushed the chore/precommit-message-rule branch from d33b17b to cf2b2f9 Compare June 18, 2024 10:30
@FranceBe FranceBe force-pushed the chore/precommit-message-rule branch from cf2b2f9 to df24ea1 Compare June 18, 2024 10:31
@FranceBe FranceBe closed this Jun 18, 2024
@FranceBe FranceBe reopened this Jun 18, 2024
Copy link

sonarcloud bot commented Jun 18, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@Francois-Gomis
Copy link
Collaborator

@FranceBe Is the branch still active?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants