-
Notifications
You must be signed in to change notification settings - Fork 466
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
Example of --regex flag in use #391
Comments
See for example here: This will check words within underscore separated variable names. It's not perfect, but it's the best I've got so far, I think due to some Python regex limitations. |
Thinking about it, this will only match three letter or more words. But I've a feeling I couldn't do +? for non-greedy in Python. |
I was surprised that the default regex includes codespell/codespell_lib/_codespell.py Line 29 in 2d12d7a
It's a surprising default since so much code uses It seems like using I'll see if I can get a moment to write this up into the README. |
It seems reasonable to me to change the default actually, and document how to get the old behavior back for people who end up needing it |
The `_` character was included via the `\w` character class. The default regular expression now unrolls the `\w` and drops `_` from it. This caused words in `snake_case` variables to be missed by codespell. Resolves codespell-project#391
The `_` (underscore) character was included in the default regular expression for words via the `\w` character class. The default now unrolls `\w` and drops `_` from it. This caused words in `snake_case` variables to be missed by codespell. Resolves codespell-project#391
The `_` (underscore) character was included in the default regular expression for words via the `\w` character class. The default now unrolls `\w` and drops `_` from it. This caused words in `snake_case` variables to be missed by codespell. Resolves codespell-project#391
The `_` (underscore) character was included in the default regular expression for words via the `\w` character class. The default now unrolls `\w` and drops `_` from it. This caused words in `snake_case` variables to be missed by codespell. Resolves codespell-project#391
The `_` (underscore) character was included in the default regular expression for words via the `\w` character class. The default now unrolls `\w` and drops `_` from it. This caused words in `snake_case` variables to be missed by codespell. Resolves codespell-project#391
Thank you for the example. Ended up extending it a bit to catch subwords for [c|C]amelCase and snake_case. 😄 |
Can someone demonstrate how to use the codespell --regex= flag?
The text was updated successfully, but these errors were encountered: