Issue #3657 <https://github.com/leo-editor/leo-editor/issues/3657> suggests 
that Leo should *always *write black-compatible sentinel lines. Leo would 
no longer need the *--black-sentinels* command line option.


This post discusses this proposal and asks for your comments.


*Background*


Black <https://pypi.org/project/black/> adds a space between the # and @ at 
the start of Leo's sentinel comments, treating such comments according to 
the PEP8 <https://peps.python.org/pep-0008/> guidelines for inline comments 
<https://peps.python.org/pep-0008/#inline-comments>.


As a result, *Black will continually reformat Leo's external files* unless 
the --black-sentinels command line option was in effect when Leo wrote the 
external files.


The Black devs do not appear interested in treating Leo's sentinels as 
exceptions!


*Compatibility*


For at least the last several years, Leo has been able to read external 
files containing "blackened" comments. I know of no significant 
compatibility issues.


*Summary*


Like it or not, Black is the de-facto standard for formatting Python 
programs. The Ruff Format 
<https://github.com/astral-sh/ruff/blob/main/crates/ruff_python_formatter/README.md>
 tool 
emulates Black's operation.


Imo, Leo should *always *write Black-compatible sentinels. Doing so will 
remove a reason for not using Leo! 


Leonine projects (including Leo!) will notice large diffs when Leo converts 
sentinel comments to the Black-compatible format. These diffs are a 
*one-time* cost of this proposal.


Afaik, this proposal has no other negative consequences.


Your comments, please.


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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/d46d95a7-1e2c-4c64-9086-3ae6db0ef0a3n%40googlegroups.com.

Reply via email to