Skip to content

Commit 2f8f097

Browse files
chore: keep ruff's formatter out of the Markdown guides (#51)
ruff 0.16 formats fenced Python blocks in Markdown by default, and the guides hold fragments that read as code but are not programs: a keyword argument shown on its own becomes an assignment, a method body without its def loses its indentation. The Dependabot bump to 0.16 fails on 24 such files. Markdown is excluded from the formatter, which is what its documentation prescribes; the setting is harmless under the ruff in the lock today.
1 parent 1fa239d commit 2f8f097

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎pyproject.toml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ warn_unreachable = true
110110
[tool.ruff]
111111
line-length = 120
112112
target-version = "py311"
113-
extend-exclude = ["examples"]
113+
# The Markdown guides hold fragments -- a keyword argument on its own, a body
114+
# without its def -- that read as code to a formatter and come out as
115+
# something else. ruff 0.16 formats fenced Python in Markdown by default.
116+
extend-exclude = ["examples", "*.md"]
114117

115118
[tool.ruff.lint]
116119
select = ["F", "E", "W", "I", "B", "N", "S", "C4", "DTZ", "SIM", "TRY", "PERF", "RUF", "UP", "ANN", "T20", "PTH", "PLC", "PLE", "PLW"]

0 commit comments

Comments
 (0)