chore: re-enable the mdformat pre-commit hook and reformat markdown - #602
Draft
leoschwarz wants to merge 2 commits into
Draft
chore: re-enable the mdformat pre-commit hook and reformat markdown#602leoschwarz wants to merge 2 commits into
leoschwarz wants to merge 2 commits into
Conversation
The hook was commented out in 989f4bc as a workaround for #437, where markdown formatting appeared to change for no reason. The cause was #424 bumping mdformat 0.7.17 -> 1.0.0 while also dropping mdformat-mkdocs: the plugin was what produced 4-space nested list indents, and 0.7.17 escaped `[Unreleased]` as `\[Unreleased\]` (fixed upstream in 0.7.18). The diff committed in 989f4bc is byte-for-byte the output of the *old* pin, so it came from a stale local mdformat rather than the pinned hook. Pin mdformat 1.0.0 with mdformat-gfm (tables) and mdformat-simple-breaks (`---` instead of 70 underscores). mdformat-myst is unusable: 0.3.0 escapes `:::{note}` to `:::\{note}`, breaking MyST colon fences. Since the hook now unescapes changelog headings, relax the nox changelog check to accept both forms, matching what the extract-changelog action already did, and cover the unescaped form in that action's tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mdformatpre-commit hook, pinned to mdformat 1.0.0 withmdformat-gfm(tables) andmdformat-simple-breaks(---rather than a row of 70 underscores). Markdown formatting is deterministic again after being off since February.## \[1.20.0\]becomes## [1.20.0], sonox -s changelognow accepts both forms and the extract-changelog action gained a test for the unescaped one.mdformat-mkdocs. The reformat committed in 989f4bc is byte-for-byte the output of the old pin, so it came from a stale local mdformat, not from the pinned hook.pre-commit run mdformat --all-files.Closes #437
🤖 Prepared with assistance from Claude Opus 5 via Claude Code.