MezzoNZ / crunchy

Automatically exported from code.google.com/p/crunchy
0 stars 0 forks source link

Pylint integration #141

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Pylint[1] is a powerful code analyzer, which can help students to improve
the quality of their code.

If Pylint is available on the system, after each execution of code from an
editor (editor/doctest/unittest modes), Pylint should analyze the code and
provide a report.

I think only the pylint rate should be displayed under the editor field,
and the student should click on it to obtain the full report. 

Because Pylint forces to use strong convention, a configuration option
should allow to choice another Pylint configuration file (to change or
delete some convention).

[1] Pylint - http://www.logilab.org/857

Original issue reported on code.google.com by florian....@gmail.com on 9 Jul 2008 at 1:53

GoogleCodeExporter commented 8 years ago
This is a good idea but it should probably be disabled by default (even if 
pylint is
available) and made available via a configuration setting; otherwise, it might 
be too
intimidating for beginners.

I agree with the suggestion to only show the pylint score as a link under the 
editor
field.

Original comment by andre.ro...@gmail.com on 9 Jul 2008 at 1:59

GoogleCodeExporter commented 8 years ago
In all cases, I will add an option to enable/disable it.

Maybe we can work on the interface to make it less intimidating (if there is 
just the
score, it can be easily ignored)...

A beginner who learns python step by step will, at each step, see some errors or
warnings, and will probably try to write a better code for this step. I think 
this
can be better than discover, after some week/month passed to learn python, that
Pylint has an enormous lists of errors because of some bad habits.

Original comment by florian....@gmail.com on 9 Jul 2008 at 2:10

GoogleCodeExporter commented 8 years ago
I've committed a first prototype in my branch (r824). For the moment, it is a
separate plugin (an editor with an "Run analyzer" button). I'll work on an
integration with editor/doctest/unittest later.

I have a problem about how sending the output of pylint to the client (in the
pylint_runner_callback of plugins/vlam_pylint.py). I can make it work by using
exec_code, but this doesn't have sense. Can anyone look the code?

Original comment by florian....@gmail.com on 10 Jul 2008 at 9:18

GoogleCodeExporter commented 8 years ago
Regarding comment 3:

request.wfile.write gets sends to the browser ... which doesn't know where to 
put it.

All the comet stuff has been cleverly designed by Johannes to redirect io to the
appropriate object.

I'll make some changes to your code and commit.

Original comment by andre.ro...@gmail.com on 11 Jul 2008 at 12:15

GoogleCodeExporter commented 8 years ago
Ok, thanks!

The question is now... how to tell it where put the report? I'm waiting your 
changes.

Original comment by florian....@gmail.com on 11 Jul 2008 at 12:18

GoogleCodeExporter commented 8 years ago
Changing label: this should definitely be included in 1.0.

Original comment by andre.ro...@gmail.com on 11 Jul 2008 at 1:03

GoogleCodeExporter commented 8 years ago
I have finished the pylint support, it is available in my branch (r862). There 
is an
analyzer frontend, and a pylint backend. The choice of the analyzer (or to 
disable
analyzers) is available through a configuration option.

Some points can be improved, like the display of the score. I think also to 
write
another backend, to make sure that the abstraction of the analyzer frontend 
works well.

Original comment by florian....@gmail.com on 17 Jul 2008 at 9:32

GoogleCodeExporter commented 8 years ago
I've added a PyChecker backend, and that works.

Original comment by florian....@gmail.com on 21 Jul 2008 at 11:52

GoogleCodeExporter commented 8 years ago
And now the third backend: PyFlakes, in r878.

Original comment by florian....@gmail.com on 24 Jul 2008 at 11:22

GoogleCodeExporter commented 8 years ago
Included in main documentation.  Revision 1032.

Original comment by andre.ro...@gmail.com on 5 Oct 2008 at 11:56