from
Stani Michiels <s_t_a_n_i at gmx dot net>
to
Nicolas Chauvat <nico at logilab dot fr>
subject
SPE & PyLint
date
2004/12/22 13:19
Dear Nicolas,Hello, I noticed the UML view of SPE v0.7. That's really nice. I saw that you also have support for pychecker and other tools and wanted to suggest integration of http://www.logilab.org/projects/pylint/ PyLint is already integrated in emacs, pydev for eclipse and eric (IIRC).
I'll download it and I'll try it. Of course I'm intrested in integrating it, but actually is more a matter or time. Currently I'm fixing out bugs for the mac and later I want to implement a debugger. However you could speed up the integration by writing some code for SPE. I guess the implementation will be similar to PyChecker. Therefore you should have a look at _spe/Plugin/PyCheck.py If you need any help, ask! I just tried the pylint-gui.bat, but whatever module I give, it doesn't go further than:
C:\Python23\Scripts>rem = """-*-Python-*- script
Am I missing something?
When I try to run lint.py on _spe, I get the following error:
...
************* Module _spe.plugins.pychecker2.tests.class
W:107: Bad indentation. Found 3 spaces, expected 4
W:109: Bad indentation. Found 3 spaces, expected 4
W: 0: Missing docstring
W: 0: Missing required attribute "__revision__"
C: 12:D: Invalid name "D" (should match [A-Z][a-zA-Z0-9]+$)
W: 12:D: Missing docstring
W: 12:D: Class has no __init__ method
C: 13:D.B: Invalid name "B" (should match [A-Z][a-zA-Z0-9]+$)
W: 13:D.B: Missing docstring
W: 13:D.B: Class has no __init__ method
C: 15:D.B.x: Too short name "x"
W: 15:D.B.x: Missing docstring
W: 16:D.B.x: Attribute 'inherited1' defined outside __init__
R: 13:D.B: Not enough public methods (1/2)
R: 12:D: Not enough public methods (0/2)
C: 18:A: Invalid name "A" (should match [A-Z][a-zA-Z0-9]+$)
W: 18:A: Missing docstring
E: 23:A.f: Method doesn't have "self" as first argument
C: 23:A.f: Too short name "f"
W: 23:A.f: Missing docstring
C: 23:A.f: Too short name "s"
C: 28:A.x: Too short name "x"
W: 28:A.x: Missing docstring
E: 28:A.x: Method has no argument
W: 28:A.x: Arguments number differs from overriden method
C: 31:A.y: Too short name "y"
W: 31:A.y: Missing docstring
C: 34:A._z: Too short name "_z"
W: 34:A._z: Missing docstring
W: 32:A.y: Attribute 'a' defined outside __init__
W: 25:A.f: Attribute 'self' defined outside __init__
W: 32:A.y: Attribute 'b' defined outside __init__
E: 41:A._z: Access to undefined member 'value'
E: 21:A.__init__: Access to undefined member 'w'
E: 38:A._z: Access to undefined member 'w'
W: 46:E: Class has no __init__ method
C: 46:E: Invalid name "E" (should match [A-Z][a-zA-Z0-9]+$)
W: 46:E: Missing docstring
C: 47:E.f: Too short name "f"
W: 47:E.f: Missing docstring
R: 46:E: Not enough public methods (1/2)
E: 48:E.f: Access to undefined member 'value'
C: 50:F: Invalid name "F" (should match [A-Z][a-zA-Z0-9]+$)
W: 50:F: Missing docstring
C: 51:F.f: Too short name "f"
W: 51:F.f: Missing docstring
C: 54:H: Invalid name "H" (should match [A-Z][a-zA-Z0-9]+$)
W: 54:H: Missing docstring
C: 55:H.f: Too short name "f"
W: 55:H.f: Missing docstring
C: 58:I: Invalid name "I" (should match [A-Z][a-zA-Z0-9]+$)
W: 58:I: Missing docstring
C: 59:I.f: Too short name "f"
W: 59:I.f: Missing docstring
C: 62:J: Invalid name "J" (should match [A-Z][a-zA-Z0-9]+$)
W: 62:J: Missing docstring
C: 63:J.f: Too short name "f"
W: 63:J.f: Missing docstring
C: 66:K: Invalid name "K" (should match [A-Z][a-zA-Z0-9]+$)
W: 66:K: Missing docstring
C: 67:K.f: Too short name "f"
W: 67:K.f: Missing docstring
C: 74:z: Too short name "z"
W: 74:z: Missing docstring
W: 77:z.L: Class has no __init__ method
C: 77:z.L: Invalid name "L" (should match [A-Z][a-zA-Z0-9]+$)
W: 77:z.L: Missing docstring
C: 78:z.L.f: Too short name "f"
W: 78:z.L.f: Missing docstring
R: 77:z.L: Not enough public methods (1/2)
E: 79:z.L.f: Access to undefined member 'childNodes'
C: 82:zz: Too short name "zz"
W: 82:zz: Missing docstring
W: 85:zz.L: Class has no __init__ method
C: 85:zz.L: Invalid name "L" (should match [A-Z][a-zA-Z0-9]+$)
W: 85:zz.L: Missing docstring
C: 86:zz.L.f: Too short name "f"
W: 86:zz.L.f: Missing docstring
E: 87:zz.L.f: Access to undefined member 'childNodes'
R: 85:zz.L: Not enough public methods (1/2)
W: 90:zzz: Missing docstring
C: 93:zzz.L: Invalid name "L" (should match [A-Z][a-zA-Z0-9]+$)
W: 93:zzz.L: Missing docstring
W: 93:zzz.L: Class has no __init__ method
C: 94:zzz.L.f: Too short name "f"
W: 94:zzz.L.f: Missing docstring
R: 93:zzz.L: Not enough public methods (1/2)
E: 95:zzz.L.f: Access to undefined member 'childNodes'
W: 98:zzzz: Missing docstring
F: 99:zzzz: Unable to import 'tests.nested' (No module named tests)
W:101:zzzz.L: Class has no __init__ method
C:101:zzzz.L: Invalid name "L" (should match [A-Z][a-zA-Z0-9]+$)
W:101:zzzz.L: Missing docstring
C:102:zzzz.L.f: Too short name "f"
W:102:zzzz.L.f: Missing docstring
R:101:zzzz.L: Not enough public methods (1/2)
E:103:zzzz.L.f: Access to undefined member 'x'
W:106:Base: Class has no __init__ method
W:106:Base: Missing docstring
C:107:Base.f: Too short name "f"
W:107:Base.f: Missing docstring
C:107:Base.f: Too short name "x"
C:107:Base.f: More than one statement on a single line
R:106:Base: Not enough public methods (1/2)
W:108:Derived: Missing docstring
W:108:Derived: Class has no __init__ method
W:109:Derived.f: Arguments number differs from overriden method
C:109:Derived.f: Too short name "f"
W:109:Derived.f: Missing docstring
C:109:Derived.f: More than one statement on a single line
R:108:Derived: Not enough public methods (1/2)
W:111:Node: Missing docstring
W:111:Node: Class has no __init__ method
C:112:Node.getChildren: Invalid name "getChildren" (should match [a-z_][a-z0-9_]
*$)
W:112:Node.getChildren: Missing docstring
C:112:Node.getChildren: Too short name "x"
R:111:Node: Not enough public methods (1/2)
W:115:Node2: Missing docstring
Traceback (most recent call last):
File "C:\Python23\Lib\site-packages\logilab\pylint\lint.py", line 956, in ?
Run(sys.argv[1:])
File "C:\Python23\Lib\site-packages\logilab\pylint\lint.py", line 922, in __in
it__
linter.check(args)
File "C:\Python23\Lib\site-packages\logilab\pylint\lint.py", line 625, in chec
k
self.check_file(filepath, modname, checkers)
File "C:\Python23\Lib\site-packages\logilab\pylint\lint.py", line 650, in chec
k_file
self._check_file(filepath, modname, checkers)
File "C:\Python23\Lib\site-packages\logilab\pylint\lint.py", line 664, in _che
ck_file
self.check_astng_module(astng, checkers)
File "C:\Python23\Lib\site-packages\logilab\pylint\lint.py", line 721, in chec
k_astng_module
self.astng_events(astng, [checker for checker in checkers
File "C:\Python23\Lib\site-packages\logilab\pylint\lint.py", line 738, in astn
g_events
self.astng_events(child, checkers)
File "C:\Python23\Lib\site-packages\logilab\pylint\lint.py", line 738, in astn
g_events
self.astng_events(child, checkers)
File "C:\Python23\Lib\site-packages\logilab\pylint\lint.py", line 738, in astn
g_events
self.astng_events(child, checkers)
File "C:\Python23\Lib\site-packages\logilab\pylint\lint.py", line 738, in astn
g_events
self.astng_events(child, checkers)
File "C:\Python23\Lib\site-packages\logilab\pylint\lint.py", line 735, in astn
g_events
checker.visit(astng)
File "C:\Python23\Lib\site-packages\logilab\common\astng\utils.py", line 91, i
n visit
method(node)
File "C:\Python23\Lib\site-packages\logilab\pylint\checkers\classes.py", line
190, in visit_function
self.check_init(node)
File "C:\Python23\Lib\site-packages\logilab\pylint\checkers\classes.py", line
355, in check_init
to_call, unresolved = self._ancestors_to_call(node)
File "C:\Python23\Lib\site-packages\logilab\pylint\checkers\classes.py", line
428, in _ancestors_to_call
baseastng = baseastng.resolve(part)
File "C:\Python23\Lib\site-packages\logilab\common\astng\astng.py", line 201,
in resolve
raise ResolveError(name)
logilab.common.astng.ResolveError: ast
The implementation will be quite similar as pychecker indeed, just parsing the linenumbers. I suppose C,R,W stand for something. If I ship pylint with spe, I need to strip it down to its minimum. Could you make me a list of the files needed. (I saw pylint also depends on the common library.)
Bye for now,
Stani
PS Please use from now on this mail and always put SPE in the subject. On peut aussi parler français.
