dprint-plugin-rusty provides four formatter plugins for dprint: one for PHP files using mago, one for Lua files using StyLua, one for Markdown using rumdl, and one for Nix files using Alejandra. All are compiled to WebAssembly and plug into dprint like any other plugin.
Using dprint plugins lets you keep a single, consistent formatting workflow across polyglot repos. The mago plugin applies mago's PHP formatter, the StyLua plugin formats Lua with the same rules as StyLua, the rumdl plugin applies rumdl's fixer/linter to Markdown content, and the Alejandra plugin formats Nix files.
Add the mago plugin to your dprint configuration to format PHP files.
{
"$schema": "https://dprint.dev/schemas/v0.json",
"plugins": [
"https://github.com/mridang/dprint-plugin-rusty/releases/download/v1.0.0/mago.wasm"
],
"includes": [
"**/*.php",
"**/*.phtml"
]
}dprint fmt --log-level=debugThis plugin exposes line width, indent width, and tabs vs spaces (mirrors dprint's global settings).
Add the StyLua plugin to your dprint configuration to format Lua files.
{
"$schema": "https://dprint.dev/schemas/v0.json",
"plugins": [
"https://github.com/mridang/dprint-plugin-rusty/releases/download/v1.0.0/stylua.wasm"
],
"includes": [
"**/*.lua"
]
}dprint fmt --log-level=debugThis plugin exposes line width, indent width, tabs vs spaces, and quote style. Other StyLua options use upstream defaults.
Add the rumdl plugin to your dprint configuration to format Markdown files.
{
"$schema": "https://dprint.dev/schemas/v0.json",
"plugins": [
"https://github.com/mridang/dprint-plugin-rusty/releases/download/v1.0.0/rumdl.wasm"
],
"includes": [
"**/*.md",
"**/*.mdx",
"**/*.qmd"
]
}dprint fmt --log-level=debugThis plugin exposes line width and flavor (Markdown dialect). It uses rumdl's auto-fix pipeline and returns the fixed content.
Add the Alejandra plugin to your dprint configuration to format Nix files.
{
"$schema": "https://dprint.dev/schemas/v0.json",
"plugins": [
"https://github.com/mridang/dprint-plugin-rusty/releases/download/v1.0.0/alejandra.wasm"
],
"includes": [
"**/*.nix"
]
}dprint fmt --log-level=debugThis plugin exposes line width, indent width, and tabs vs spaces. Alejandra is an opinionated formatter, so most formatting decisions are made by the upstream library.
- Only mago, StyLua, rumdl, and Alejandra are provided (no Ruby formatter).
Contributions are welcome! If you find a bug or have suggestions for improvement, please open an issue or submit a pull request.
Apache License 2.0 © 2025 Mridang Agarwalla