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
Reading configuration from pyproject.toml #356
Comments
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗 |
Thanks for the issue! I'm inclined to reject this to reduce configuration parsing complexity and to not set a bad precedent for what will be merged in the future. pyproject.toml is a Python specific file so I really like that Python specific tools (pytest, black, tox, mypy etc.) support it. Mdformat is a programming language agnostic tool, however, so I don't think it should support a Python specific file. |
Thanks for replying! I think we can leave this open and see if it gets some traction. I can definitely understand not wanting to add more stuff due to the "maintainance tax" down the road and I understand the rationale behind it. Implementation right now seems easy so if you need a PR just mention me and I could give it a go. |
Definitely in favor of adding support for What about adding a |
I created this plugin which covers the request of this issue. |
Context
It has become increasingly adopted the option to store the configuration of many tools inside the pyproject.toml file.
example for black:
https://ichard26-testblackdocs.readthedocs.io/en/refactor_docs/pyproject_toml.html
It would be amazing if mdformat could read it as well. And since mdformat already supports toml format configurations, it would be trivial to implement looking for the configuration in the
tool.mdformat
section of one's pyproject.toml fileProposal
I think an approach would be ...
modify this function:
mdformat/src/mdformat/_conf.py
Lines 26 to 44 in 2b3145d
so that:
.mdformat.toml
pyproject.toml
tool.mdformat
section.mdformat.toml
LMK what you think, I could make it a PR later in the week
Tasks and updates
The text was updated successfully, but these errors were encountered: