Skip to content

Add an option to invert the check (fail if RegExp succeeds) #92

Open
@happycollision

Description

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Are you willing to sponsor your idea?

  • Yes, I like to sponsor this request

Is your feature request related to a problem? Please describe

I am trying to fail if a commit message starts with fixup or squash. I am also trying to fail if a message contains [no-merge]. It is far easier to check for the existence of these things than confirm the negative.

Describe the solution you'd like

A new flag: failOnMatch. It defaults to false (current behavior). Setting to true will fail if the pattern matches on a commit.

Describe alternatives you've considered

RegExp negative lookahead. Ugh. Not easy to understand for the next person to look at the code. (AKA me, in five minutes.)

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions