Skip to content

ci: exclude markdown from ruff format - #51

Merged
StuBehan merged 1 commit into
mainfrom
ruff-exclude-markdown
Sep 8, 2026
Merged

StuBehan merged 1 commit into
mainfrom
ruff-exclude-markdown

Conversation

@StuBehan

@StuBehan StuBehan commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

lint & format is red on main right now, and on every open PR, without anyone having changed a line of code.

CI does pip install ruff with 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.md and docs/speech-normalization.md. 0.15 checks 20 files and passes, 0.16 checks 26 and fails. Confirmed it fails on ed4a44d itself 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_speech signature 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 *.md from the formatter and leaves it to the code. Both versions now check 20 files and pass, ie ruff 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 🤷

@StuBehan
StuBehan merged commit 71b58e7 into main Sep 8, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant