[Python-projects] pylint bug using enable-msg
Sylvain Thénault
sylvain.thenault at logilab.fr
Thu Feb 7 10:49:31 CET 2008
On Fri, Feb 01, 2008 at 09:15:13AM -0800, Toshio Kuratomi wrote:
> Hi all,
Hi,
> I think I've found a bug in pylint's re-enabling of a msg
> behavior. The problem seems to be very whitespace sensitive. The
> following short snippet fails to re-enable the msg and generate the
> expected E1101 message. I'll also attach it as a patch against::
> pylint-0.14.0/test/input/func_block_disable_msg.py
>
> def meth9(self):
> """test re-enabling right after a block with whitespace"""
> eris = 5
>
> if eris:
> print ("In block")
>
> # pylint: disable-msg=E1101
> # no error
> print self.bla
> print self.blu
> # pylint: enable-msg=E1101
> # error
> print self.blip
> diff -up ./test/input/func_block_disable_msg.py.bak ./test/input/func_block_disable_msg.py
> --- ./test/input/func_block_disable_msg.py.bak 2008-01-31 21:03:57.000000000 -0800
> +++ ./test/input/func_block_disable_msg.py 2008-02-01 09:13:12.000000000 -0800
> @@ -86,6 +86,20 @@ class Foo(object):
> print self.bla
> print self.blop
>
> + def meth9(self):
> + """test re-enabling right after a block with whitespace"""
> + eris = 5
> +
> + if eris:
> + print ("In block")
> +
> + # pylint: disable-msg=E1101
> + # no error
> + print self.bla
> + print self.blu
> + # pylint: enable-msg=E1101
> + # error
> + print self.blip
>
> class ClassLevelMessage(object):
> """should'nt display to much attributes/not enough methods messages
Yep, that's a bug. I've fixed it in the repository. Thanks for the
report and test case :)
regards,
--
Sylvain Thénault LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian: http://www.logilab.fr/formations
Développement logiciel sur mesure: http://www.logilab.fr/services
Python et calcul scientifique: http://www.logilab.fr/science
More information about the Python-Projects
mailing list