Leo's pylint Command Enhanced

15 views
Skip to first unread message

Thomas Passin

unread,
Feb 10, 2023, 9:04:56 AM2/10/23
to leo-editor
The pylint command now can run pylint against a subtree that is not an external file (@file, @clean, ...).

The old behavior is still in place.  The command looks up the tree from the focused node to see if that node is in the subtree of an external Python file.  If yes, it runs against that file.  Otherwise it looks down the tree to find any external Python files there, and runs pylint against them.

With this change, if no external Python files were found, the command writes the entire tree of the focused node to an temporary file and runs pylint against that.  The messages emitted by the command in the log pane go the the correct line *in the Leo outline* when clicked.

I often write code that doesn't need to be an actual external file - because it will be dispatched as a Leo command, for example - but I want to check it.  That's the purpose of this new behavior.

Edward K. Ream

unread,
Feb 10, 2023, 9:38:22 AM2/10/23
to leo-e...@googlegroups.com
On Fri, Feb 10, 2023 at 8:04 AM Thomas Passin <tbp1...@gmail.com> wrote:
The pylint command now can run pylint against a subtree that is not an external file (@file, @clean, ...).

Many thanks, Thomas, for this work. For a long time I didn't think this was possible. Your PR does the job simply and cleanly.

Edward

Thomas Passin

unread,
Feb 10, 2023, 10:49:57 AM2/10/23
to leo-editor
: ) 
Reply all
Reply to author
Forward
0 new messages