Drat: I hit the "Post Message" button trying to format some text. Here is the full post.
Leo issue
#2983 suggests supporting so-called
blackened sentinels, sentinel lines that start with
"# @" instead of the usual
"#@". Such lines can arise in external files created by @file after the user reformats the file with
Black.
PR
#2985 contains the changes, which involve
inherently dangerous changes to Leo's read code.
#2983 gives the rationale for accepting the risks involved, which I'll repeat here:
- Leo cannot prevent Leonistas from blackening external files unintentionally. Black's existence imposes a burden on Leo.
- Leo should not prevent Leonistas from blackening external files intentionally.
--black-sentinels can help avoid huge diffs in projects mandating Black.
- Any change to Leo's read/write code is inherently dangerous, but doing nothing may be more dangerous in the long run.
Summary of changes
Leo has (supposedly) been able to handle blackened sentinels for a long time. However, recent tests have exposed problems with Leo's legacy code. The new code fixes several bugs, some serious (potentially damaging data!) and some less so (crashers).
The PR adds support for
--black-sentinels
(aka -b), which causes Leo to write blackened sentinels.
Testing status
I have strengthened several unit tests to test for both blackened and legacy sentinels.
All of Leo's files pass round-trip read/write tests, both with and without
-b. This is the strongest test I know of.
I have been eating my own dog food without any serious problems.
Summary
PR #2985 contains inherently dangerous changes to Leo's read code.
I have tested the code as well as I can, but
additional testing seems wise before merging PR #2985
into devel. Please test that branch now.
I'll wait about a week before doing the merge. Please report any problems immediately.
Edward