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

error even if the regex matches #22

Open
BigHoss opened this issue Nov 5, 2021 · 2 comments
Open

error even if the regex matches #22

BigHoss opened this issue Nov 5, 2021 · 2 comments

Comments

@BigHoss
Copy link

BigHoss commented Nov 5, 2021

I implemented the hook and I get an error even it matches.

[Invalid Commit Message]
------------------------
Valid types: build
 ci
 docs
 feat
 fix
 perf
 refactor
 style
 test
 chore
Max length (first line): 52
Min length (first line): 1
Regex: ^[.0-9]+$|build
|ci
|docs
|feat
|fix
|perf
|refactor
|style
|test
|chore)(\(.+\))?: .{1,52}$
Actual commit message: "refactor(async): almost done"
Actual length: 29

and I also dont get it why my regex has line breaks in it

I am on windows

@cmwolke-gamedesign
Copy link

Same issue. The regex seems to be invalid according to https://regex101.com/, since there's an unmatched ellipsis.

@electronum
Copy link

electronum commented Dec 21, 2023

  • The regexp start or revert/merge part seem to be incorrect: sailr.sh#L60
    regexp="${regexp}^([Rr]evert|[Mm]erge):? )?.*$|^("
  • As noted above, the closing brace between question marks ? )? is unmatched, the expression could be improved in general
  • The opening brace ( was removed in 6d047d0
    @@ -48,10 +48,10 @@ function set_config_values() {
    -  regexp="^("
    +  regexp="^[.0-9]+$|"
    
    -  regexp="${regexp}revert: )?(\w+)("
    +  regexp="${regexp}^([Rr]evert|[Mm]erge):? )?.*$|^("

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

No branches or pull requests

3 participants