ci: exclude markdown from ruff format - #51
Merged
Merged
Conversation
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.
lint & formatis red on main right now, and on every open PR, without anyone having changed a line of code.CI does
pip install ruffwith no pin (ci.yml:25), so it picks up whatever is newest. Ruff 0.16 started formatting python code blocks inside markdown, and we have two files with blocks that predate it -README.mdanddocs/speech-normalization.md. 0.15 checks 20 files and passes, 0.16 checks 26 and fails. Confirmed it fails oned4a44ditself so its not coming from any branch.Could just run the formatter over the two files, but I dont think we want what it does to them. The
normalize_for_speechsignature in the docs aligns its trailing comments into a column so the flags read as a table, and 0.16 collapses that and squashes-> str: ...onto one line. Its illustrative code in a prose file, not something we import - the layout is there to be read.So this excludes
*.mdfrom the formatter and leaves it to the code. Both versions now check 20 files and pass, ieruff format --check .locally agrees with CI again, which it hadn't been (CONTRIBUTING tells you to run exactly that).Lint itself was never affected,
ruff check .passes on 0.16 either way, so this is only the format side.Worth saying the underlying thing is still there - unpinned linter means the next ruff release can do this again. Happy to pin it in a follow up if you'd rather, I left it out of here to keep this small 🤷