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

New Rule: body-match-regex #146

Merged
merged 1 commit into from
Sep 11, 2020
Merged

New Rule: body-match-regex #146

merged 1 commit into from
Sep 11, 2020

Conversation

jorisroovers
Copy link
Owner

The body-match-regex rule allows users to enforce that the commit-msg
body matches a given regex.

Closes #130

The body-match-regex rule allows users to enforce that the commit-msg
body matches a given regex.

Closes #130
@jorisroovers jorisroovers merged commit cb94a49 into master Sep 11, 2020
@jorisroovers jorisroovers deleted the body-match-regex branch September 11, 2020 11:17

# Ensure body contains the word "Foo" somewhere
[body-match-regex]
regex=(*.)Foo(.*)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example has two problems.

  1. the prefix should be (.*)
  2. the prefix and postfix are totally unnecessary. The Python code is doing a search so the (.*) isn't going to make a difference

I suppose it would make more sense to match the word Foo (and not Foolish) as follows:

# Ensure body contains the word "Foo" somewhere in the body
[body-match-regex]
regex=\bFoo\b

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.

New Rule: body-match-regex
2 participants