[Python-projects] pylint: Messages (dis)appear depending on order of file names

Maarten ter Huurne maarten.ter.huurne at philips.com
Fri Apr 20 20:13:03 CEST 2007


Hi,

I noticed that in our automated daily checks problems were found by PyLint 
that were not found if I run PyLint on the command line. After stepswise 
simplifcation, I found out that it is the order of the module file names 
on the command line that determines whether the problems are flagged or 
not. Here is a stripped down example:

$ pylint --version
No config file found, using default configuration
pylint 0.13.1,
astng 0.17.0, common 0.21.2
Python 2.4.4c1 (#2, Oct 11 2006, 21:51:02)
[GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)]
$ cat module1.py
'Module 1'

from module2 import Clazz

OBJ = Clazz()
OBJ.AttRiBuTE = None
$ cat module2.py
'Module 2'

class Clazz(object):
    'Dummy class'
    def method1(self):
        'Dummy method 1'
        pass
    def method2(self):
        'Dummy method 2'
        pass
$ pylint -rn module1.py module2.py
No config file found, using default configuration
************* Module module1
C:  6: Invalid name "AttRiBuTE" (should match [a-z_][a-z0-9_]{2,30}$)
W:  6: Attribute 'AttRiBuTE' defined outside __init__
$ pylint -rn module2.py module1.py
No config file found, using default configuration
$

As you can see in the example, the messages (true positives) are only 
issued if "module1.py" is passed before "module2.py" on the command line.

Is it possible that the order of module file names on the command line 
also determines the order in which modules are checked and that for some 
reason (bug) whether or not an imported module was already checked makes a 
difference for the kind of messages that are issued?

Bye,
                Maarten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.logilab.org/pipermail/python-projects/attachments/20070420/98fd4a9e/attachment.html 


More information about the Python-Projects mailing list