About code cleaning

13 views
Skip to first unread message

Edward K. Ream

unread,
Sep 22, 2021, 9:38:09 AM9/22/21
to leo-editor
I have recently labeled two issues "Won'tDo":

#2210: Blacken most files,
#2195: Convert trailing hanging comments.

I spent several hours experimenting with these issues. My firm conclusion is that neither issue is even remotely worth doing.

About black

The opening comment of #2210 lists the reasons why black is not suitable for Leo.

Important: Leo can "survive" applying black to an external file. This has been true for several years.  But #2213 reports a recently-discovered buglet involving just-blackened files.

pylint checks

There is a reason to enable pylint's multiple-statements checker. In particular, changing:

if whatever: return

to:

if whatever:
     return


helps coverage testing.

Imo, pylint's trailing-whitespace checker should remain disabled. It's easy enough to run Leo's clean-all-lines command from time to time. Pristine lines should not be a condition for approving a PR!

Summary

Imo, most code cleaning is make work.  I'll consider PR's related to code formatting. I rather doubt that anyone will bother.

Leo must not use black as a standard for code formatting.

Pylint's multiple-statements complaints are worth fixing. They create problems for coverage testing.

Edward
Reply all
Reply to author
Forward
0 new messages