Regex match vs search
See original GitHub issueSome rules’ regular expressions are used with .search
, some with .match
, and the only source which one it is appears to be the gitlint source.
search: title-match-regex, body-match-regex match: author-valid-email, ignore-by-title, ignore-by-body, ignore-body-lines, ignore-by-author-name
I think it would be good to standardize on just one of these for all regex matching. I suggest going with .search
, because .match
is a Python oddity not present in any other language I know of. (It’s kind of ironic and unfortunate that the rules that have match
in their name are the ones for which we do not invoke match, but search.)
Then again, standardizing on one would be a breaking change. If that’s not acceptable or will take some time, I think we should document which method is used with each rule. I’m available to help with that or making the search/match change (if we’re going with search 😉), let me know.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:5 (3 by maintainers)
Good catch, I agree with the suggestion to standardize on
search
.Wrt deprecation strategy:
enable_regex_style_search=true
, let me know if you have a better suggestion)enable_regex_style_search
flag is set.Released as part of 0.18.0, closing!