] > SPE & PyLint (Logilab.org)

Email SPE & PyLint

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
<blockquote type="cite"> <pre>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 <a href="javascript:ol('http://www.logilab.org/projects/pylint/');">http://www.logilab.org/projects/pylint/</a> PyLint is already integrated in emacs, pydev for eclipse and eric (IIRC). </pre> </blockquote> Dear Nicolas,<br/> 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:<br/>     C:\Python23\Scripts>rem = """-*-Python-*- script<br/><br/> Am I missing something?<br/><br/> When I try to run lint.py on _spe, I get the following error:<br/> ...<br/> ************* Module _spe.plugins.pychecker2.tests.class<br/> W:107: Bad indentation. Found 3 spaces, expected 4<br/> W:109: Bad indentation. Found 3 spaces, expected 4<br/> W:  0: Missing docstring<br/> W:  0: Missing required attribute "__revision__"<br/> C: 12:D: Invalid name "D" (should match [A-Z][a-zA-Z0-9]+$)<br/> W: 12:D: Missing docstring<br/> W: 12:D: Class has no __init__ method<br/> C: 13:D.B: Invalid name "B" (should match [A-Z][a-zA-Z0-9]+$)<br/> W: 13:D.B: Missing docstring<br/> W: 13:D.B: Class has no __init__ method<br/> C: 15:D.B.x: Too short name "x"<br/> W: 15:D.B.x: Missing docstring<br/> W: 16:D.B.x: Attribute 'inherited1' defined outside __init__<br/> R: 13:D.B: Not enough public methods (1/2)<br/> R: 12:D: Not enough public methods (0/2)<br/> C: 18:A: Invalid name "A" (should match [A-Z][a-zA-Z0-9]+$)<br/> W: 18:A: Missing docstring<br/> E: 23:A.f: Method doesn't have "self" as first argument<br/> C: 23:A.f: Too short name "f"<br/> W: 23:A.f: Missing docstring<br/> C: 23:A.f: Too short name "s"<br/> C: 28:A.x: Too short name "x"<br/> W: 28:A.x: Missing docstring<br/> E: 28:A.x: Method has no argument<br/> W: 28:A.x: Arguments number differs from overriden method<br/> C: 31:A.y: Too short name "y"<br/> W: 31:A.y: Missing docstring<br/> C: 34:A._z: Too short name "_z"<br/> W: 34:A._z: Missing docstring<br/> W: 32:A.y: Attribute 'a' defined outside __init__<br/> W: 25:A.f: Attribute 'self' defined outside __init__<br/> W: 32:A.y: Attribute 'b' defined outside __init__<br/> E: 41:A._z: Access to undefined member 'value'<br/> E: 21:A.__init__: Access to undefined member 'w'<br/> E: 38:A._z: Access to undefined member 'w'<br/> W: 46:E: Class has no __init__ method<br/> C: 46:E: Invalid name "E" (should match [A-Z][a-zA-Z0-9]+$)<br/> W: 46:E: Missing docstring<br/> C: 47:E.f: Too short name "f"<br/> W: 47:E.f: Missing docstring<br/> R: 46:E: Not enough public methods (1/2)<br/> E: 48:E.f: Access to undefined member 'value'<br/> C: 50:F: Invalid name "F" (should match [A-Z][a-zA-Z0-9]+$)<br/> W: 50:F: Missing docstring<br/> C: 51:F.f: Too short name "f"<br/> W: 51:F.f: Missing docstring<br/> C: 54:H: Invalid name "H" (should match [A-Z][a-zA-Z0-9]+$)<br/> W: 54:H: Missing docstring<br/> C: 55:H.f: Too short name "f"<br/> W: 55:H.f: Missing docstring<br/> C: 58:I: Invalid name "I" (should match [A-Z][a-zA-Z0-9]+$)<br/> W: 58:I: Missing docstring<br/> C: 59:I.f: Too short name "f"<br/> W: 59:I.f: Missing docstring<br/> C: 62:J: Invalid name "J" (should match [A-Z][a-zA-Z0-9]+$)<br/> W: 62:J: Missing docstring<br/> C: 63:J.f: Too short name "f"<br/> W: 63:J.f: Missing docstring<br/> C: 66:K: Invalid name "K" (should match [A-Z][a-zA-Z0-9]+$)<br/> W: 66:K: Missing docstring<br/> C: 67:K.f: Too short name "f"<br/> W: 67:K.f: Missing docstring<br/> C: 74:z: Too short name "z"<br/> W: 74:z: Missing docstring<br/> W: 77:z.L: Class has no __init__ method<br/> C: 77:z.L: Invalid name "L" (should match [A-Z][a-zA-Z0-9]+$)<br/> W: 77:z.L: Missing docstring<br/> C: 78:z.L.f: Too short name "f"<br/> W: 78:z.L.f: Missing docstring<br/> R: 77:z.L: Not enough public methods (1/2)<br/> E: 79:z.L.f: Access to undefined member 'childNodes'<br/> C: 82:zz: Too short name "zz"<br/> W: 82:zz: Missing docstring<br/> W: 85:zz.L: Class has no __init__ method<br/> C: 85:zz.L: Invalid name "L" (should match [A-Z][a-zA-Z0-9]+$)<br/> W: 85:zz.L: Missing docstring<br/> C: 86:zz.L.f: Too short name "f"<br/> W: 86:zz.L.f: Missing docstring<br/> E: 87:zz.L.f: Access to undefined member 'childNodes'<br/> R: 85:zz.L: Not enough public methods (1/2)<br/> W: 90:zzz: Missing docstring<br/> C: 93:zzz.L: Invalid name "L" (should match [A-Z][a-zA-Z0-9]+$)<br/> W: 93:zzz.L: Missing docstring<br/> W: 93:zzz.L: Class has no __init__ method<br/> C: 94:zzz.L.f: Too short name "f"<br/> W: 94:zzz.L.f: Missing docstring<br/> R: 93:zzz.L: Not enough public methods (1/2)<br/> E: 95:zzz.L.f: Access to undefined member 'childNodes'<br/> W: 98:zzzz: Missing docstring<br/> F: 99:zzzz: Unable to import 'tests.nested' (No module named tests)<br/> W:101:zzzz.L: Class has no __init__ method<br/> C:101:zzzz.L: Invalid name "L" (should match [A-Z][a-zA-Z0-9]+$)<br/> W:101:zzzz.L: Missing docstring<br/> C:102:zzzz.L.f: Too short name "f"<br/> W:102:zzzz.L.f: Missing docstring<br/> R:101:zzzz.L: Not enough public methods (1/2)<br/> E:103:zzzz.L.f: Access to undefined member 'x'<br/> W:106:Base: Class has no __init__ method<br/> W:106:Base: Missing docstring<br/> C:107:Base.f: Too short name "f"<br/> W:107:Base.f: Missing docstring<br/> C:107:Base.f: Too short name "x"<br/> C:107:Base.f: More than one statement on a single line<br/> R:106:Base: Not enough public methods (1/2)<br/> W:108:Derived: Missing docstring<br/> W:108:Derived: Class has no __init__ method<br/> W:109:Derived.f: Arguments number differs from overriden method<br/> C:109:Derived.f: Too short name "f"<br/> W:109:Derived.f: Missing docstring<br/> C:109:Derived.f: More than one statement on a single line<br/> R:108:Derived: Not enough public methods (1/2)<br/> W:111:Node: Missing docstring<br/> W:111:Node: Class has no __init__ method<br/> C:112:Node.getChildren: Invalid name "getChildren" (should match [a-z_][a-z0-9_]<br/> *$)<br/> W:112:Node.getChildren: Missing docstring<br/> C:112:Node.getChildren: Too short name "x"<br/> R:111:Node: Not enough public methods (1/2)<br/> W:115:Node2: Missing docstring<br/> Traceback (most recent call last):<br/>   File "C:\Python23\Lib\site-packages\logilab\pylint\lint.py", line 956, in ?<br/>     Run(sys.argv[1:])<br/>   File "C:\Python23\Lib\site-packages\logilab\pylint\lint.py", line 922, in __in<br/> it__<br/>     linter.check(args)<br/>   File "C:\Python23\Lib\site-packages\logilab\pylint\lint.py", line 625, in chec<br/> k<br/>     self.check_file(filepath, modname, checkers)<br/>   File "C:\Python23\Lib\site-packages\logilab\pylint\lint.py", line 650, in chec<br/> k_file<br/>     self._check_file(filepath, modname, checkers)<br/>   File "C:\Python23\Lib\site-packages\logilab\pylint\lint.py", line 664, in _che<br/> ck_file<br/>     self.check_astng_module(astng, checkers)<br/>   File "C:\Python23\Lib\site-packages\logilab\pylint\lint.py", line 721, in chec<br/> k_astng_module<br/>     self.astng_events(astng, [checker for checker in checkers<br/>   File "C:\Python23\Lib\site-packages\logilab\pylint\lint.py", line 738, in astn<br/> g_events<br/>     self.astng_events(child, checkers)<br/>   File "C:\Python23\Lib\site-packages\logilab\pylint\lint.py", line 738, in astn<br/> g_events<br/>     self.astng_events(child, checkers)<br/>   File "C:\Python23\Lib\site-packages\logilab\pylint\lint.py", line 738, in astn<br/> g_events<br/>     self.astng_events(child, checkers)<br/>   File "C:\Python23\Lib\site-packages\logilab\pylint\lint.py", line 738, in astn<br/> g_events<br/>     self.astng_events(child, checkers)<br/>   File "C:\Python23\Lib\site-packages\logilab\pylint\lint.py", line 735, in astn<br/> g_events<br/>     checker.visit(astng)<br/>   File "C:\Python23\Lib\site-packages\logilab\common\astng\utils.py", line 91, i<br/> n visit<br/>     method(node)<br/>   File "C:\Python23\Lib\site-packages\logilab\pylint\checkers\classes.py", line<br/> 190, in visit_function<br/>     self.check_init(node)<br/>   File "C:\Python23\Lib\site-packages\logilab\pylint\checkers\classes.py", line<br/> 355, in check_init<br/>     to_call, unresolved = self._ancestors_to_call(node)<br/>   File "C:\Python23\Lib\site-packages\logilab\pylint\checkers\classes.py", line<br/> 428, in _ancestors_to_call<br/>     baseastng = baseastng.resolve(part)<br/>   File "C:\Python23\Lib\site-packages\logilab\common\astng\astng.py", line 201,<br/> in resolve<br/>     raise ResolveError(name)<br/> logilab.common.astng.ResolveError: ast<br/><br/> 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.)<br/><br/> Bye for now,<br/> Stani<br/><br/> PS Please use from now on this mail and always put SPE in the subject. On peut aussi parler français.<br/><br class="partseparator"/></div><div class="navcontenttop"></div><div class="row"><span class="label">in thread</span><div class="field"><a href="http://www.logilab.org/emailthread/1327" title="">SPE & PyLint</a></div></div><div class="row"><span class="label">has reply</span><div class="field"><div class="email"><i>sent date 2005/01/03 17:31</i> <b>from</b> Sylvain Thénault <<a href="http://www.logilab.org/emailaddress/sylvain.thenault%40logilab.fr">sylvain.thenault at logilab dot fr</a>> <b>to</b> Stani Michiels <<a href="http://www.logilab.org/emailaddress/s_t_a_n_i%40gmx.net">s_t_a_n_i at gmx dot net</a>> <br/> <a href="http://www.logilab.org/email/1330">[Python-projects] Re: SPE & PyLint</a></div></div></div></td><td valign="top"></td><td valign="top"></td></tr></table><div class="navcontentbottom"><div id="commentsectionComponent" class="mainRelated commentsection" erudi:rooteid="1326"> (<a href="javascript: replacePageChunk('comment1326Holder', 'Any%20X%20WHERE%20X%20eid%201326', 'inlinecomment');">add comment</a>)<div id="comment1326Holder"></div></div></div></div> </div> </td> </tr></table></div> <div class="footer"><a href="http://www.logilab.org/changelog">what's new?</a> | <a href="http://www.logilab.org/doc/about">about this site</a> | © 2001-2008 <a href="http://www.logilab.fr">Logilab S.A.</a></div></body> </html>