Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend docstring-code-format to python snippets in MarkDown, RST etc #9326

Closed
peterjc opened this issue Dec 30, 2023 · 3 comments
Closed

Extend docstring-code-format to python snippets in MarkDown, RST etc #9326

peterjc opened this issue Dec 30, 2023 · 3 comments
Labels
docstring Related to docstring linting or formatting formatter Related to the formatter

Comments

@peterjc
Copy link

peterjc commented Dec 30, 2023

With ruff introducing the docstring-code-format setting, the tool might start to follow what https://pypi.org/project/blacken-docs/ offers - not just black style formatting to doctests within Python files, but also doctests and Python snippets within reStructuredText files (*.rst, often used for Python project documentation), Markdown files (*.md), and even LaTeX files (*.tex).

Is this something you think could be on the ruff roadmap? Or might it be better to look at other ways to achieve this, e.g. one might try modifying blacken-docs to invoke either black (as now) or the ruff formatter internally.

@charliermarsh charliermarsh added docstring Related to docstring linting or formatting formatter Related to the formatter labels Dec 31, 2023
@charliermarsh
Copy link
Member

👍 We do plan to support this though not sure if it's still captured in any open issues. @BurntSushi -- do you know if there's an issue for this?

@charliermarsh
Copy link
Member

Ahh found it, I believe this is the same as #8237.

@peterjc
Copy link
Author

peterjc commented Jan 2, 2024

Agreed, closing in favour of #8237. I'm surprised I missed that in my issue searches. Thanks!

@peterjc peterjc closed this as not planned Won't fix, can't repro, duplicate, stale Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docstring Related to docstring linting or formatting formatter Related to the formatter
Projects
None yet
Development

No branches or pull requests

2 participants