You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This check is for formatting code samples in docs (not docstrings), which I think ruff doesn’t support yet (basically all the pieces are there, but not the infrastructure. If the link is missing, that’s a bug, will check!
I think we should be recommending it, but we should also make sure we don't have overlap with blacken-docs trying to format code blocks in python files. I'd not thought of it doing that, but if it does, we should note how to avoid it.
Activity
henryiii commentedon Dec 16, 2023
It doesn’t support .md or .rst files quite yet. It should soon.
blink1073 commentedon Dec 16, 2023
Ah, good call out, thanks!
nstarman commentedon Apr 27, 2024
When it does support these file types, then this can replaceAnswered.blacken-docs, right?astral-sh/ruff#8237
jarrodmillman commentedon Jul 4, 2024
When using ruff for docstring formatting, should repo-review mark not using blacken-doc in red?

And this link doesn't seem to exist: https://learn.scientific-python.org/development/guides/style/#PC111
henryiii commentedon Jul 4, 2024
This check is for formatting code samples in docs (not docstrings), which I think ruff doesn’t support yet (basically all the pieces are there, but not the infrastructure. If the link is missing, that’s a bug, will check!
jarrodmillman commentedon Jul 5, 2024
If we add
- id: ruff-formatin.pre-commit-config.yaml, we can add thisto
pyproject.tomlto enable some docstring code formatting. Is it worth mentioning this option? If not, should we be cautioning against it.https://docs.astral.sh/ruff/formatter/#configuration
henryiii commentedon Aug 7, 2024
I think we should be recommending it, but we should also make sure we don't have overlap with blacken-docs trying to format code blocks in python files. I'd not thought of it doing that, but if it does, we should note how to avoid it.
henryiii commentedon Jul 24, 2026
It supports markdown files now, as of 0.16. (not rst, AFAICT). https://astral.sh/blog/ruff-v0.16.0