Notes about pylint and code cleaning

19 views
Skip to first unread message

Edward K. Ream

unread,
Sep 28, 2021, 7:07:36 AM9/28/21
to leo-editor
Yesterday I uploaded a new version of leo/core/pylint-leo-rc-ref.txt.

Notes:

1. Devs should copy this file to their ~/.leo directory and rename it to pylint-leo-rc.txt.

This is the dev's local config file. Devs are free to ignore pylint checkers such as 'import-error' in their local config file.

2. Devs can run pylint externally using pylint-leo.py.  For example, here is my ll.cmd file:

python -m pylint-leo %*

I use ll.cmd rather than pylint.cmd to save typing, and to avoid any possibly of a clash with a pylint script in python/scripts.

Use `ll -h` to see a list of options. `ll -a` runs pylint on all of Leo's files.

3. Within Leo, devs can use Leo's pylint command. The advantage of doing so is that pylint errors create clickable links. The disadvantage is that Leo almost (but not quite) hangs while running pylint.

4. I typically disable newly-added pylint checkers unless they add significant checks. Recently, most have not.  "consider-this", "consider-that" are mostly make work.

5. I recently enabled several format checks which complain about bad indentation, etc.

6. I now routinely use Leo's 'beautify-files' command to regularize whitespace.

All questions and comments welcome.

Edward

tbp1...@gmail.com

unread,
Sep 28, 2021, 8:07:35 AM9/28/21
to leo-editor
What branch is that on?  I don't see it in devel.

Edward K. Ream

unread,
Sep 28, 2021, 10:24:00 AM9/28/21
to leo-editor
On Tue, Sep 28, 2021 at 7:07 AM tbp1...@gmail.com <tbp1...@gmail.com> wrote:
What branch is that on?  I don't see it in devel.

Oops.  The file is in leo/test, not leo/core.

Edward
Reply all
Reply to author
Forward
0 new messages