Skip to content

Explain how to enable Markdown formatting for pre-commit hook#23077

Merged
amyreese merged 2 commits intoastral-sh:mainfrom
mkniewallner:docs/hint-pre-commit-markdown-formatting
Feb 5, 2026
Merged

Explain how to enable Markdown formatting for pre-commit hook#23077
amyreese merged 2 commits intoastral-sh:mainfrom
mkniewallner:docs/hint-pre-commit-markdown-formatting

Conversation

@mkniewallner
Copy link
Contributor

Summary

When running Ruff through pre-commit, since types_or does not include markdown, Markdown files are not included. I believe it could be useful to indicate what needs be done in that case.

We could also set markdown to ruff-format hook, but we probably don't want to do that until the feature is stable?

Test Plan

Tested the hook locally on a project using Markdown files.

For the documentation, checked it locally:
image

Copy link
Contributor

@ntBre ntBre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I had one concern about the version field, but this seems great to have.

```yaml title=".pre-commit-config.yaml"
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not that familiar with pre-commit, but is it possible to use something like latest here or omit the rev field? I'm just afraid that it will quickly become outdated.

We could instead add this file to the list of files updated in releases:

version_files = [

but I'd want to remember to remove it if we add this directly to the hook after stabilization, as you said.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I misremembered and thought we automatically included all files in docs directory!

@ntBre ntBre requested a review from amyreese February 4, 2026 21:42
@ntBre ntBre added the documentation Improvements or additions to documentation label Feb 4, 2026
@amyreese amyreese merged commit 0f02d48 into astral-sh:main Feb 5, 2026
58 checks passed
@mkniewallner mkniewallner deleted the docs/hint-pre-commit-markdown-formatting branch February 5, 2026 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants