Skip to content

Add markdown to types_or - #159

Open
34j wants to merge 1 commit into
astral-sh:mainfrom
34j:patch-1
Open

Add markdown to types_or#159
34j wants to merge 1 commit into
astral-sh:mainfrom
34j:patch-1

Conversation

@34j

@34j 34j commented Mar 11, 2026

Copy link
Copy Markdown

Summary

Now *.md files are in tool.ruff.include by default and may be used with tool.ruff.format.preview = True, etc.

https://docs.astral.sh/ruff/settings/#include

astral-sh/ruff@4795eca#diff-959aaaf28345388cb476e91b1a8b127625bffba0ca2f8ed794f687bd27e50302

Test Plan

  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: v0.15.5
    hooks:
      - id: ruff-format
        types_or: [python, pyi, jupyter, markdown]

@MichaReiser

Copy link
Copy Markdown
Member

Thank you. I think we should wait until the feature is out of preview before changing our defaults.

@mxr

mxr commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

Could you update the types_or in the README.md too?

@henryiii

Copy link
Copy Markdown
Contributor

It came out of preview! https://astral.sh/blog/ruff-v0.16.0

@ntBre ntBre left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! Looks straightforward to me, I just suggested dropping markdown from the linter invocation. Could you also add it to the README as suggested by the comments?

Happy to handle it if you'd prefer, I know it has been a long time :)

Comment thread .pre-commit-hooks.yaml
entry: ruff check --force-exclude
language: python
types_or: [python, pyi, jupyter]
types_or: [python, pyi, jupyter, markdown]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think I'd just exclude this line for now. It shouldn't really hurt anything, but ruff check still doesn't perform any checks on Markdown files, only ruff format.

Suggested change
types_or: [python, pyi, jupyter, markdown]
types_or: [python, pyi, jupyter]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants