summaryrefslogtreecommitdiff
path: root/pylint/utils.py
diff options
context:
space:
mode:
authorClaudiu Popa <cpopa@cloudbasesolutions.com>2015-03-23 23:47:07 +0200
committerClaudiu Popa <cpopa@cloudbasesolutions.com>2015-03-23 23:47:07 +0200
commitb8f8c4a9cc582fa1e9998fd2171630de67baa8b1 (patch)
treeaceb3e2484f18c547d4dc414888a98bab8e3bed7 /pylint/utils.py
parent8781e101f49715f33c70e595ba88adb4f59713fe (diff)
downloadpylint-git-b8f8c4a9cc582fa1e9998fd2171630de67baa8b1.tar.gz
Allow ending a pragma control with a semicolon.
In this way, users can continue a pragma control with a reason for why it is used, as in `# pylint: disable=old-style-class;reason=...`. Closes issue #449.
Diffstat (limited to 'pylint/utils.py')
-rw-r--r--pylint/utils.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pylint/utils.py b/pylint/utils.py
index 6c5b9754f..f220793ca 100644
--- a/pylint/utils.py
+++ b/pylint/utils.py
@@ -72,7 +72,10 @@ MSG_STATE_SCOPE_CONFIG = 0
MSG_STATE_SCOPE_MODULE = 1
MSG_STATE_CONFIDENCE = 2
-OPTION_RGX = re.compile(r'\s*#.*\bpylint:(.*)')
+# Allow stopping after the first semicolon 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}')
# The line/node distinction does not apply to fatal errors and reports.
_SCOPE_EXEMPT = 'FR'