-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pylint
is less eager to consume the whole line for pragmas
The regex was adapted so that we either stop at one of `;` or `#`, or at the end of the line. This should improve the situation a little bit when dealing with the flags of other linters. Close #2485
- Loading branch information
1 parent
5d066ed
commit daef49a
Showing
4 changed files
with
25 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# pylint: disable=missing-docstring | ||
|
||
|
||
def test_pragma(): | ||
"""Test that the control pragmas are not too eager to consume the entire line | ||
We should stop either at: | ||
- ; or # | ||
- or at the end of line | ||
""" | ||
# noqa: E501 # pylint: disable=unused-variable #nosec | ||
variable = 1 | ||
|
||
# noqa # pylint: disable=undefined-variable,no-member; don't trigger | ||
other_variable = some_variable + variable.member | ||
|
||
# noqa # pylint: disable=unbalanced-tuple-unpacking,no-member # no trigger | ||
first, second = some_other_variable | ||
return first + other_variable.method() |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters