Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions docs/formatter.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,25 @@ with [`extend-include`](settings.md#extend-include) in your project settings:
extend-include = ["docs/*.md"]
```

To format Markdown files with extensions other than `.md`, configure custom
[`extension`](settings.md#extension) mappings. Ruff will automatically include
these mapped extensions in file discovery:

=== "pyproject.toml"

```toml
[tool.ruff]
# Treat `.mdx` and `.qmd` files as Markdown
extension = { mdx = "markdown", qmd = "markdown" }
```

=== "ruff.toml"

```toml
# Treat `.mdx` and `.qmd` files as Markdown
extension = {mdx="markdown", qmd="markdown"}
```

If you run Ruff via [`ruff-pre-commit`](https://github.com/astral-sh/ruff-pre-commit), Markdown
support needs to be explicitly included by adding it to `types_or`:

Expand Down