from
Fabio Zadrozny <fabioz at esss dot com dot br>
to
Sylvain Thenault <syt at logilab dot fr>
subject
FW: PyLint 0.6 bug
date
Hi Sylvain, remember me?2005/01/21 11:39
I just updated to version 0.6, but I'm still unable to use it.
E.g. If I have the code below:
from qt import *
class C(QWidget):pass
I'm getting the traceback posted below.
The thing is qt is actually defined as a dll
(C:\bin\Python23\Lib\site-packages\qt.pyd), so, there is no way you could
get its ast (you MUST import it to get its tokens) - I had the same problem
for doing code completion for the pydev editor. I based my solution on
having the concept of an AbstractModule (that had the logic exposed),
CompiledModule and SourceModule... (maybe you can also work on that idea),
as for you (I believe) you just want compiled module tokens to see if they
exist and not anything else.
I believe this would happen using any compiled module, but have not tested
for others...
Traceback (most recent call last):
File
"D:\dev_programs\eclipse_3\eclipse\workspace\org.python.pydev\PySrc\ThirdPar
ty\logilab\pylint
\../../../ThirdParty\logilab\common\astng\builder.py", line 207, in
visit_from
imported = self._manager.astng_from_module_name(node.modname)
File
"D:\dev_programs\eclipse_3\eclipse\workspace\org.python.pydev\PySrc\ThirdPar
ty\logilab\pylint
\../../../ThirdParty\logilab\common\astng\manager.py", line 147, in
astng_from_module_name
return self.astng_from_module(load_module_from_name(modname), modname)
File
"D:\dev_programs\eclipse_3\eclipse\workspace\org.python.pydev\PySrc\ThirdPar
ty\logilab\pylint
\../../../ThirdParty\logilab\common\astng\manager.py", line 161, in
astng_from_module
return self.astng_from_file(filepath, modname or module.__name__)
...Many more of the same
File
"D:\dev_programs\eclipse_3\eclipse\workspace\org.python.pydev\PySrc\ThirdPar
ty\logilab\pylint
\../../../ThirdParty\logilab\common\astng\manager.py", line 144, in
astng_from_module_name
filepath = file_from_modpath(modname.split('.'))
File
"D:\dev_programs\eclipse_3\eclipse\workspace\org.python.pydev\PySrc\ThirdPar
ty\logilab\pylint
\../../../ThirdParty\logilab\common\modutils.py", line 123, in
file_from_modpath
return _file_from_modpath(modpath, search_path)
File
"D:\dev_programs\eclipse_3\eclipse\workspace\org.python.pydev\PySrc\ThirdPar
ty\logilab\pylint
\../../../ThirdParty\logilab\common\modutils.py", line 134, in
_file_from_modpath
path = abspath(path)
File "C:\bin\python23\lib\ntpath.py", line 487, in abspath
return normpath(path)
RuntimeError: maximum recursion depth exceeded Unable to get imported names
for 'qt' line 1"
************* Module test1
W0401: 1: Wildcard import
W0232: 3:C: Class has no __init__ method
E0602: 3:C: Undefined variable 'QWidget'
C0321: 3:C: More than one statement on a single line
Report
======
3 statements analysed.
Duplication
-----------
now previous difference
:::::::::::::::::::::::::::::::::::::::::::::::::::
nb duplicated lines 0 0 =
percent duplicated lines 0.000 0.000 =
Raw metrics
-----------
type number % previous difference
:::::::::::::::::::::::::::::::::::::::::::
code 2 50.00 9 -7.00
docstring 0 0.00 6 -6.00
comment 0 0.00 0 =
empty 2 50.00 12 -10.00
Statistics by type
------------------
type number old number difference %documented %badname
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
module 1 1 = 0.00 0.00
class 1 2 -1.00 0.00 100.00
method 0 2 -2.00 0.00 0.00
function 0 1 -1.00 0.00 0.00
Total errors / warnings
-----------------------
type number previous difference
::::::::::::::::::::::::::::::::::::::
convention 1 4 -3.00
refactor 0 1 -1.00
warning 2 15 -13.00
error 1 0 +1.00
Messages
--------
message id occurences
::::::::::::::::::::::
W0401 1
W0232 1
E0602 1
C0321 1
Global evaluation
-----------------
Your code has been rated at -16.67/10 (previous run: -10.00/10)
[]s
Fabio Zadrozny
------------------------------------------------------
Software Developer
ESSS - Engineering Simulation and Scientific Software www.esss.com.br
-----Original Message-----
From: python-list-bounces+fabioz=esss.com.br@python.org
[mailto:python-list-bounces+fabioz=esss.com.br@python.org] On Behalf Of
Sylvain Thenault
Sent: sexta-feira, 21 de janeiro de 2005 09:25
To: python-list@python.org
Subject: [ANN] PyLint 0.6
Hi there,
I'm very pleased to announce the 0.6 release of PyLint. This release fix a
lot of bugs and should be much more stable than the 0.5 release where
stopping actual import of analyzed modules has been introduced (and that's
really a huge improvment, since this was potentialy introducing some side
effects). There are also more documentation, a better test suite, and also
minor new features was added. Every users of pylint should update to 0.6.
Notice that Logilab's common library 0.9 is required
(http://www.logilab.org/projects/common).
Enjoy !
What's new ?
------------
* refix pylint emacs mode
* no more traceback when just typing "pylint"
* fix a bug which may cause crashes on resolving parent classes
* fix problems with the format checker: don't chock on files
containing multiple CR, avoid C0322, C0323, C0324 false positives
with triple quoted string with quote inside
* correctly detect access to member defined latter in __init__ method
* now depends on common 0.8.1 to fix problem with interface resolution
(close #8606)
* new --list-msgs option describing available checkers and their
messages
* added windows specific documentation to the README file, contributed
by Brian van den Broek
* updated doc/features.txt (actually this file is now generated using
the --list-msgs option), more entries into the FAQ
* improved tests coverage
What is pylint ?
----------------
Pylint is a python tool that checks if a module satisfy a coding
standard. Pylint can be seen as another pychecker since nearly all
tests you can do with pychecker can also be done with Pylint. But
Pylint offers some more features, like checking line-code's length,
checking if variable names are well-formed according to your coding
standard, or checking if declared interfaces are truly implemented,
and much more (see http://www.logilab.org/pylint/ for the complete
check list). The big advantage with Pylint is that it is highly
configurable, customizable, and you can easily write a small plugin to
add a personal feature.
The usage it quite simple :
$ pylint mypackage.mymodule
This command will output all the errors and warnings related to the
tested code (here : mypackage.mymodule), will dump a little summary at
the end, and will give a mark to the tested code.
Pylint is free software distributed under the GNU Public Licence.
Home page
---------
http://www.logilab.org/projects/pylint
Download
--------
ftp://ftp.logilab.org/pub/pylint
Mailing list
------------
mailto://python-projects@lists.logilab.org
--
Sylvain Thénault LOGILAB, Paris (France).
http://www.logilab.com http://www.logilab.fr http://www.logilab.org
--
http://mail.python.org/mailman/listinfo/python-list
