docs: Enable Ruff formatting of Python code blocks in Markdown - #78
Merged
Conversation
Requires Ruff 0.16, which flags CPY001 under `select = ["ALL"]` - added to the ignore list, matching the other Apify Python repos.
janbuchar
approved these changes
Jul 29, 2026
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.
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] includewas an allowlist of*.pyglobs, so no Markdown file would have reached the formatter anyway.This bumps Ruff to
~=0.16.0and adds**/*.mdand**/*.mdxtoinclude, together with theextension = { mdx = "markdown" }mapping that MDX needs (without it Ruff would try to parse.mdxas 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) underselect = ["ALL"], so it is added to the ignore list, matching apify-sdk-python, apify-client-python and crawlee-python.No changes to the
lint/formatPoe tasks are needed.lintalready runsruff format --checkandformatalready runsruff format, so both pick Markdown up automatically. Note thatruff check(lint rules) does not support Markdown yet, so only formatting is enforced there.Notes
includeallowlist to a single**/*.pyglob. This is a pure simplification: no tracked.pyfile lives outsidesrc/andtests/, and Ruff processes exactly the same 8 files before and after.✍️ Drafted by Claude Code