On Tuesday, May 17, 2016 at 1:19:46 PM UTC-5, Edward K. Ream wrote:
>
> pyflakes <https://pypi.python.org/pypi/pyflakes>is a *much* faster (20x 
> or more) version of pylint, and in some ways does a better job.  
>

pyflakes is more like 100x faster than pylint, and 10x faster than flake8. 
pyflakes is the natural tool to run when saving .leo files.  flake8 is 
enough slower that it wouldn't be so useful.

So it is worth considerable effort to eliminate all pyflakes complaints. 
This is usually possible with a bit of effort.  For example, warnings about 
unused code can be silenced with an assert.  Ugly, but feasible.

As another example, warnings that raw_input is undefined (in Python 3) can 
be suppressed by "fetching" it from the builtins module:

f = builtins.input if g.isPython3 else builtins.raw_input
    # Suppress pyflakes complaint.
leoid = f('LeoID: ')

Again, not pretty.  A pylint-style suppression comment would be better, 
imo.  I may complain to the pyflakes people, but I don't have a lot of 
hope...

Done:

- Added a reference copy of flake8.txt to leo/test.
- Created two separate commands: flake8 and pyflakes.

Still to do:

- Configure the flake8 options.statistics, options.total_errors and 
options.benchmark settings from flake8.txt.
  - Should be easy.  It's not.  I may have to ask for help.
  - At present, these settings are set to True, True and False respectively.
- Optionally use flake8 to check external files on save, just as Leo 
presently checks their syntax.
  flake8 is easily fast enough to make this feasible.
- Add leo/flake8-leo.py, so that people can run flake8 on Leo's sources, 
just as with pylint-leo.py.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to