fix: ledger files pass markdownlint MD012 #101
No reviewers
Labels
No labels
Agent
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
joshtronic/igor!101
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/ledger-markdownlint"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The ledger template ended with "## Index\n\n" -- a trailing blank
line that markdownlint MD012 (no-multiple-blanks) flagged on
every newly-created ledger, breaking brain's
npm test. Theheading-to-list spacing for MD022 was the original intent, but
applying it eagerly meant an empty ledger had two consecutive
blanks at EOF.
Three changes:
ledger_init's heredoc no longer trails a blank line. Empty
ledgers end at "## Index\n" -- one newline, clean EOF.
ledger_append_urls detects "this is the first URL" and inserts
a blank-line separator before it. Once URLs are present, the
list is correctly separated from the heading (MD022 happy);
when no URLs exist, no trailing blank (MD012 happy).
ledger_strip_trailing_blanks helper added, called from
ledger_init whenever the file already exists. Existing broken
ledgers (the three created by today's earlier ticks) auto-heal
on the next discretionary-read invocation -- the next
commit_brain_changes picks up the normalization, brain CI
passes after that.
Verified end-to-end:
exit 0 (file shrinks from 7 lines ending in \n\n to 6 lines
ending in \n)
Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com
The ledger template ended with "## Index\n\n" -- a trailing blank line that markdownlint MD012 (no-multiple-blanks) flagged on every newly-created ledger, breaking brain's `npm test`. The heading-to-list spacing for MD022 was the original intent, but applying it eagerly meant an empty ledger had two consecutive blanks at EOF. Three changes: 1. ledger_init's heredoc no longer trails a blank line. Empty ledgers end at "## Index\n" -- one newline, clean EOF. 2. ledger_append_urls detects "this is the first URL" and inserts a blank-line separator before it. Once URLs are present, the list is correctly separated from the heading (MD022 happy); when no URLs exist, no trailing blank (MD012 happy). 3. ledger_strip_trailing_blanks helper added, called from ledger_init whenever the file already exists. Existing broken ledgers (the three created by today's earlier ticks) auto-heal on the next discretionary-read invocation -- the next commit_brain_changes picks up the normalization, brain CI passes after that. Verified end-to-end: - Empty fresh ledger -> markdownlint exit 0 - Populated ledger (URLs appended) -> markdownlint exit 0 - Existing broken ledger run through the strip -> markdownlint exit 0 (file shrinks from 7 lines ending in \n\n to 6 lines ending in \n) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>