[Python-projects] Pylint ignore line/block

Alexandre Fayolle alexandre.fayolle at logilab.fr
Mon Oct 29 09:05:54 CET 2007


Forwarding a message received via private mail but which is relevant to
the list 

----- Forwarded message from Brent Marshall -----

From: Brent Marshall 
To: sylvain.thenault at logilab.fr
Cc: alexandre.fayolle at logilab.fr, Chris Hobbs
Date: Thu, 25 Oct 2007 08:44:25 -0400
Subject: Pylint ignore line/block

Good day,

    I was trying to find a way to make Pylint ignore a particular error
or warning for a particular line, and came across the following email in
your archives (http://www.logilab.org/email/1878), which seems to
indicate that this isn't possible.  However, the email is a couple of
years old, so I wondered whether that was still the case.

    Sylvain, in your response to Alexandre, you indicated that you were
looking for a clean way to add such a feature.  I have a suggestion that
may be acceptable:

    Perhaps a comment with a special flag, indicating the specific
errors which are to be ignored for the following line.  For example:

#!<Pylint ignore=W0702>

    Another feature which would be useful would be the ability to change
particular messages to different severities (Error/Warning/Info).  For
example, W0702 flags a condition which I would like to allow, but which
I would like flagged as "Info"

    My objective is to configure Pylint so that I get zero
Error/Warnings in my code for conditions I consider acceptable.  That
way, I won't get into the habit of ignoring warnings, and miss an
important one.

    Any assistance you can provide would be most appreciated.

    Regards,
            Brent

Brent Marshall
Advanced Solutions
Nortel
Ottawa, Canada
613 763-4955
---- End forwarded message -----

-- 
Alexandre Fayolle                              LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
Informatique scientifique:               http://www.logilab.fr/science
Reprise et maintenance de sites CPS:     http://www.migration-cms.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 481 bytes
Desc: Digital signature
Url : http://lists.logilab.org/pipermail/python-projects/attachments/20071029/1e7f5997/attachment.pgp 


More information about the Python-Projects mailing list