Skip to content

docs: Enable Ruff formatting of Python code blocks in Markdown - #78

Merged
vdusek merged 2 commits into
masterfrom
chore/enable-ruff-markdown-formatting
Jul 29, 2026
Merged

docs: Enable Ruff formatting of Python code blocks in Markdown#78
vdusek merged 2 commits into
masterfrom
chore/enable-ruff-markdown-formatting

Conversation

@vdusek

@vdusek vdusek commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

What & why

Ruff 0.16 formats Python code blocks embedded in Markdown files, and does so by default. In this repo the feature was inert twice over: the Ruff pin was ~=0.14.0, which has no Markdown support at all, and [tool.ruff] include was an allowlist of *.py globs, so no Markdown file would have reached the formatter anyway.

This bumps Ruff to ~=0.16.0 and adds **/*.md and **/*.mdx to include, together with the extension = { mdx = "markdown" } mapping that MDX needs (without it Ruff would try to parse .mdx as Python and fail). There is no Markdown in this repo containing Python code blocks today, so no file content changes - this is here to keep the four Apify Python repos configured identically.

Ruff 0.16 flags CPY001 (missing copyright notice) under select = ["ALL"], so it is added to the ignore list, matching apify-sdk-python, apify-client-python and crawlee-python.

No changes to the lint / format Poe tasks are needed. lint already runs ruff format --check and format already runs ruff format, so both pick Markdown up automatically. Note that ruff check (lint rules) does not support Markdown yet, so only formatting is enforced there.

Notes

  • The second commit collapses the include allowlist to a single **/*.py glob. This is a pure simplification: no tracked .py file lives outside src/ and tests/, and Ruff processes exactly the same 8 files before and after.

✍️ Drafted by Claude Code

vdusek added 2 commits July 29, 2026 15:09
Requires Ruff 0.16, which flags CPY001 under `select = ["ALL"]` - added to the ignore list, matching the other Apify Python repos.
@vdusek vdusek added t-tooling Issues with this label are in the ownership of the tooling team. adhoc Ad-hoc unplanned task added during the sprint. labels Jul 29, 2026
@vdusek vdusek self-assigned this Jul 29, 2026
@github-actions github-actions Bot added this to the 146th sprint - Tooling team milestone Jul 29, 2026
@vdusek vdusek changed the title chore: Enable Ruff formatting of Python code blocks in Markdown docs: Enable Ruff formatting of Python code blocks in Markdown Jul 29, 2026
@vdusek
vdusek requested a review from janbuchar July 29, 2026 13:24
@vdusek
vdusek merged commit cdf436b into master Jul 29, 2026
25 checks passed
@vdusek
vdusek deleted the chore/enable-ruff-markdown-formatting branch July 29, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants