Skip to content

Commit

Permalink
Allow ending a pragma control with a semicolon.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
PCManticore committed Mar 23, 2015
1 parent 8781e10 commit b8f8c4a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ ChangeLog for Pylint
unbalanced-tuple-unpacking, unpacking-non-sequence, non-iterator-returned.
Closes issue #388.

* 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.


2015-03-14 -- 1.4.3

* Remove three warnings: star-args, abstract-class-little-used,
Expand Down
5 changes: 4 additions & 1 deletion pylint/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ class EmptyReport(Exception):
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'
Expand Down

0 comments on commit b8f8c4a

Please sign in to comment.