-
-
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
support more sophisticated fixme warnings #2874
Comments
Sounds good, thanks for reporting the issue. |
I will try to tackle this. |
@BennyTheSen Thanks for tackling this. Yes, a separate option would be the way to go. This maps nicely to the rest of our options that also accept a regex counterpart. |
Fixed in |
I'd say "Closed as done"? |
... Although do you mind explaining how does it work though? 😕 Assuming file: """test""
__version__ = "0.1"
# FixMe: test
# FixMe: ABC-1: test-abc
# FixMe: CBA-1: test-cba and
but I got: $ pylint src/__version__.py
************* Module __version__
src/__version__.py:5:1: W0511: FixMe: test (fixme)
src/__version__.py:6:1: W0511: FixMe: ABC-1: test-abc (fixme)
src/__version__.py:7:1: W0511: FixMe: CBA-1: test-cba (fixme)
------------------------------------------------------------------
Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00) "In this case" I'd like, apart from the existing functionality, a As you can appreciate, writing negative regex is not the funniest job on the planet - especially if the regex starts getting complicated. Ofc, feel free to update documentation too ... |
"Not that happy about that", but okay. I still have a case that regex101 says should be okay, but pylint "refuses" to like it. |
That is because [pylint]
notes-rgx=(FIXME|XXX|TODO)(?!.*ABC-\d+)
enable=fixme
notes=[] This should work! |
Also [MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
notes="" # Remove the default entries for the original config file |
Note that in |
pylint confuses me anyway so much, "it doesn't matter" 😓 I am using the |
We're always happy to help with any issues 😄 The configurability of
That is indeed available! You an even use the |
Wuuuut? pylint has "auto-fix" things? 🤯 💥 ( Thanks for letting me know 😄 |
Sorry to disappoint! I meant the |
Is your feature request related to a problem? Please describe
pylint warns for configured fixme notes (defaulting to FIXME/XXX/TODO) but sometimes it would be desirable to be more flexible in how these are flagged. For example,
# FIXME: this is broken
by itself might not be ok but# FIXME: this is broken (ISSUE-1234)
might be acceptable because it points to an externally tracked issueDescribe the solution you'd like
The
notes
config value should optionally allow a regex pattern to handle more complicatedfixme
conditions (egFIXME*ISSUE-\d+
).Additional context
The checker for this rule already uses a regex pattern to flag configured notes so I think this should be easy to implement, but patterns are currently escaped before being inserted into the regex.
The text was updated successfully, but these errors were encountered: