-
Notifications
You must be signed in to change notification settings - Fork 2
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
Option to select/unselect formats #4
Comments
That makes sense to me. Maybe all formatter dependencies could be moved to python While optional The current Edited: clarified ideas for how EditorConfig could be used and general clarity |
Hi! Yeah TOML formatting was subpar. |
Thanks, I'll try it again and report back 🙂 |
Unfortunately it fails to format my TOML code blocks. % mdformat docs/work.md
Warning: Failed formatting content of a toml code block (line 90 before formatting). Filename: /media/data/dev/copier-uv/docs/work.md
Warning: Failed formatting content of a toml code block (line 321 before formatting). Filename: /media/data/dev/copier-uv/docs/work.md ```toml title="config/ruff.toml"
[per-file-ignores]
"src/your_package/your_module.py" = [
"T201", # Print statement
]
``` ```toml title="pyproject.toml"
[project]
dependencies = [
"fastapi>=1.0",
"importlib-metadata>=2.0",
]
[project.optional-dependencies]
test = [
"pytest",
]
[tool.uv]
dev-dependencies = [
"ruff",
]
``` Is that because of the |
Hmm, I can't reproduce, works on my machine :) I suspect you don't have taplo on the command line? The I could improve the error message to tell the user if taplo is not found. |
How did you install/run mdformat? What operating system did you use? If it's correct that you don't have |
Good intuition! I don't have uv tool install mdformat --with mdformat-mkdocs --with mdformat-config Unfortunately I believe uv does not yet support adding executable from dependencies into the PATH, like pipx does. Isn't there a way to call |
Ah yes, it seems
doesn't work either. I don't think subprocess.run([sys.executable, "-m", "taplo", ...]) works here, as taplo can't be run as a python module. Not sure what's the best way to solve this. Probably some combination of
|
But yeah for you I think e.g. |
Ha, right, the |
And thanks for your help @hukkin! |
Thanks for reporting! |
@pawamoy I've released version 0.2.1 where the pipx use case works for me. I don't have a Windows machine so couldn't test Windows, hope you're running linux or macos :) |
Awesome, no more errors! Thanks a lot 🎉 (I'm on Arch btw) |
I would like to unselect formatting of TOML snippets, because IMO the result is not that good:
...is formatted to:
Things I don't like in the formatted block:
I suspect you don't do anything special in this project and just load and re-dump the TOML data.
So in the end I'd just like to prevent TOML formatting and just keep JSON and YAML 🙂
The text was updated successfully, but these errors were encountered: