summaryrefslogtreecommitdiff
path: root/pylint/utils.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2018-09-29 16:06:59 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2018-09-29 16:08:15 +0200
commitdaef49a9f5623a324f65f5227f2e4a2f7cfeeff0 (patch)
treee9f99928f6a71b7926c62132796533e9a023e66e /pylint/utils.py
parent5d066ed8c8850dcf2a814f849c8b19c1bfd603a1 (diff)
downloadpylint-git-daef49a9f5623a324f65f5227f2e4a2f7cfeeff0.tar.gz
``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
Diffstat (limited to 'pylint/utils.py')
-rw-r--r--pylint/utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pylint/utils.py b/pylint/utils.py
index fb7075c9c..76afdea09 100644
--- a/pylint/utils.py
+++ b/pylint/utils.py
@@ -78,10 +78,10 @@ MSG_STATE_SCOPE_CONFIG = 0
MSG_STATE_SCOPE_MODULE = 1
MSG_STATE_CONFIDENCE = 2
-# Allow stopping after the first semicolon encountered,
+# Allow stopping after the first semicolon/hash encountered,
# so that an option can be continued with the reasons
# why it is active or disabled.
-OPTION_RGX = re.compile(r"\s*#.*\bpylint:\s*([^;]+);{0,1}")
+OPTION_RGX = re.compile(r"\s*#.*\bpylint:\s*([^;#]+)[;#]{0,1}")
# The line/node distinction does not apply to fatal errors and reports.
_SCOPE_EXEMPT = "FR"