-
Notifications
You must be signed in to change notification settings - Fork 471
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
Add --ignore-regex #1592
Add --ignore-regex #1592
Conversation
This is for issue #676, where typos are found in actually-okay URIs/emails. Because these are closer to names in context, this ignores them. Mechanically, this erases the URI/email text before the word regex is applied.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switched this to be just --ignore-regex per issue #676 discussion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pivot, a few comments on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two minor bits sorry.
codespell_lib/_codespell.py
Outdated
help='regular expression which is used to find ' | ||
'patterns to ignore by treating as whitespace. ' | ||
'When writing regexes, consider ensuring there ' | ||
'is boundary non-word chars, e.g., ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit sorry, grammar wise it should be "ensuring there are boundary..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@larsoner do you want to review this, or are you happy with mine? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@peternewman feel free to merge when you're happy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for this @jonmeow
This was originally for issue #676, but the preference there is for a different approach. We're keeping it because it may still prove useful, e.g., a regex like (?:[a-fA-F0-9]{0,4}:){2,7}[a-fA-F0-9]{0,4})\]? could be used to ignore spelling mistakes in ipv6 addresses.
Mechanically, this erases the matching text before the word regex is applied.