Skip to content

Regex match vs search #254

Closed
Closed
@scop

Description

@scop

Some 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.

Metadata

Metadata

Assignees

Labels

enhancementUser-facing feature enhancements

Projects

Status

0.18.0

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions