Skip to content

headerPattern - custom regex dont accepting "OR" condition #903

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

Closed
schirrel opened this issue Jan 24, 2020 · 7 comments
Closed

headerPattern - custom regex dont accepting "OR" condition #903

schirrel opened this issue Jan 24, 2020 · 7 comments
Labels

Comments

@schirrel
Copy link

I've set parserOpts as in the documentation:

module.exports = {
    parserOpts: {
        headerPattern: /^\[(\w*)\] - #(\d|[S\/N]+) - (.*)$/,
        headerCorrespondence: ['type', 'references', 'subject']
    }
};

this regex accept:
[NOVO] - #2 - tESTE
and
[NOVO] - #S/N - tESTE
as you can see here https://regex101.com/r/ugvxwX/1

Expected Behavior

Accepting in references a number or the string S/N

Current Behavior

git commit -m "[BUG] - #S/N - correcting modal name and mispelling grammar"
husky > commit-msg (node v11.9.0)
⧗   input: [BUG] - #S/N - correcting modal name and mispelling grammar
✖   subject must be sentence-case [subject-case]
✖   references may not be empty [references-empty]

✖   found 2 problems, 0 warnings
ⓘ   Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint

husky > commit-msg hook failed (add --no-verify to bypass)

Your Environment

Executable Version
commitlint --version 8.3.4
git --version 2.24.2
node --version 11.9.0
Windows 10
@escapedcat
Copy link
Member

@schirrel does this duplicate #895?

@schirrel
Copy link
Author

@escapedcat in some aspects can be related, but i dont believe is the same problems tho

@marionebl
Copy link
Contributor

marionebl commented Feb 6, 2020

Could you please provide a git repository that reproduces this problem?

@schirrel
Copy link
Author

@marionebl hi, sorry the delay i was very sick.

The enviroment with it is a private company repository, i will ask a few days to create a simple and similar project to share with you guys

@schirrel
Copy link
Author

hi @marionebl is this configuration
https://github.com/schirrel/commitlint-custom-format

@schirrel schirrel changed the title headerPattern? Custom Regex dont accepting or condition headerPattern? Custom Regex dont accepting "OR" condition Jul 17, 2020
@schirrel schirrel changed the title headerPattern? Custom Regex dont accepting "OR" condition headerPattern - custom regex dont accepting "OR" condition Jul 17, 2020
@FelixSauer
Copy link

Looks like the same as #607

@escapedcat
Copy link
Member

Closing this because of mentioned duplicate. Please move further discussions to #607

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

No branches or pull requests

4 participants