-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
"--notes" option ignores note tags that are entirely punctuation #5840
Comments
Did a little investigation, this is we're actually converting this option in a regular expression pattern (thereby making it awfully similar to the |
Using "\b" at the end of these patterns will only match note tags that end in an alphanumeric character, immediately followed by a non-alphanumeric character, or the end of the string. This is due to "\b" being defined as a boundary between a word character ("\w") and a non-word character ("\W"), or the end of the string. This leads to deviations like "???" being ignored when specified. Swapping "\b" for a positive lookahead that targets a whitespace, a colon, or the end of a string accounts for this. Closes pylint-dev#5840.
Turned out to be the |
I'm keeping the issue open for this reason, it seems we should not treat |
@Pierre-Sassoulas I think I was wrong. Due to the use of |
Using "\b" at the end of these patterns will only match note tags that end in an alphanumeric character, immediately followed by a non-alphanumeric character, or the end of the string. This is due to "\b" being defined as a boundary between a word character ("\w") and a non-word character ("\W"), or the end of the string. This leads to deviations like "???" being ignored when specified. Swapping "\b" for a positive lookahead that targets a whitespace, a colon, or the end of a string accounts for this. Closes #5840.
Bug description
If a note tag specified with the
--notes
option is entirely punctuation, pylint won't report a fixme warning (W0511).pylint test.py --notes="YES,???"
will return a fixme warning (W0511) for the first line, but not the second.Configuration
Command used
pylint test.py --notes="YES,???"
Pylint output
Expected behavior
Pylint version
OS / Environment
macOS 11.6.1
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: