[Python-projects] [pylint] Automatic fixing of warnings

Andres Riancho andres.riancho at gmail.com
Wed Jul 2 15:07:28 CEST 2008


Pylint users/developers,

    I'm a new to pylint, and during my first tests I found warnings
like the ones listed below that I think that could be automagically
fixed by pylint. I know that pylint is not meant to be a "refactoring
tool" but that is not what I'm asking for. The feature I would like to
see in pylint is an "--auto-fix" parameter that would try to fix the
easiest warnings. For example, in the first warning listed below,
pylint would simply have do add a space after the comma, in the second
and third cases, it should "discover" how to fill the XXX in "from
core.data.fuzzer.fuzzer import XXX"; and in the last case, it should
cut down the long line with a \ or with a \n (it depends if we are
inside a string, or outside one).

    So... this is my idea, what do you guys think?

======
C: 59:localFileInclude._fuzzRequests: Comma not followed by a space
            if self._hasNoBug(
'localFileInclude','localFileInclude',mutant.getURL() ,
mutant.getVar() ):

======
W: 24: Wildcard import core.data.fuzzer.fuzzer
======
W: 23: Unused import letters from wildcard import
W: 23: Unused import cf from wildcard import
W: 23: Unused import mutantFileName from wildcard import
W: 23: Unused import mutantCookie from wildcard import
W: 23: Unused import mutantQs from wildcard import
W: 23: Unused import randint from wildcard import
======
C: 57: Line too long (107/80)
C: 61: Line too long (92/80)
C: 66: Line too long (92/80)
C: 77: Line too long (220/80)
======

Cheers,
-- 
Andres Riancho
http://w3af.sourceforge.net/
Web Application Attack and Audit Framework


More information about the Python-Projects mailing list