This repository was archived by the owner on Aug 3, 2026. It is now read-only.
Commit cdf436b
authored
docs: Enable Ruff formatting of Python code blocks in Markdown (#78)
### 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*1 parent 831e7a3 commit cdf436b
2 files changed
Lines changed: 30 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
65 | 72 | | |
66 | 73 | | |
67 | 74 | | |
68 | 75 | | |
69 | 76 | | |
| 77 | + | |
70 | 78 | | |
71 | 79 | | |
72 | 80 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments