dprint vs rustfmt
dprint
dprint.devrustfmt
rust-lang.github.ioSide by side
| Figure | dprint | rustfmt |
|---|---|---|
| Price from | Free | Free |
| Free plan | Yes | Yes |
| Free trial | — | — |
| Open source | — | — |
| Windows | Yes | Yes |
| macOS | Yes | Yes |
| Linux | Yes | Yes |
| Self-hosted | Yes | — |
| Plans published | 1 | 1 |
| Spec score · Code Formatting Tools | 8.1 (#7) | 8.0 (#10) |
| Configuration | Projects use dprint.json, dprint.jsonc, .dprint.json or .dprint.jsonc files to define plugins, formatting settings, includes and excludes. | Configuration can be set in `rustfmt.toml` or `.rustfmt.toml`, and the default style conforms to the Rust style guide. |
| Editor integrations | The installation guide lists Visual Studio Code, IntelliJ and Neovim integrations, with the dprint language-server command usable by other editors. | The README lists integrations or usage instructions for Vim, Emacs, Sublime Text 3, Atom, Visual Studio Code, and IntelliJ or CLion. |
| License | The dprint GitHub repository is marked MIT licensed. | rustfmt is distributed under both the MIT License and Apache License 2.0. |
| Purpose | dprint is a command-line application that automatically formats code. | rustfmt formats Rust code according to style guidelines. |
| Support | The official contact page directs users to email [email protected]. | The README points users to `rustfmt --help` and `cargo fmt --help` for command usage and arguments. |
Plans
In their own words
dprint
dprint is a command-line application that automatically formats code through a configurable, pluggable system built with Rust and WebAssembly. Its official and wrapper plugins cover languages and formats including TypeScript, JavaScript, JSON, Markdown, TOML, CSS, Dockerfile, C#, Python, Go, Swift, GraphQL, YAML, PHP, LaTeX, R, and Julia. Project configuration files define plugins, formatting settings, included files, and exclusions. Plugins can be loaded from a URL or file path and pinned or versioned in configuration. The project says dprint formats hundreds of files in milliseconds and enables incremental caching by default. WebAssembly plugins run in a sandbox without network or file-system access, while process plugins are executable files and are not sandboxed. Editor integrations are listed for Visual Studio Code, IntelliJ, and Neovim; the language-server command can also be used by other editors. The CLI is distributed as a static binary with no runtime dependencies, with installation options including shell, PowerShell, Cargo, npm, and Homebrew. It is MIT-licensed and free.
rustfmt
rustfmt formats Rust code according to style guidelines. It can format files directly or read code from standard input and write formatted output to standard output. With Cargo, `cargo fmt` formats binary and library targets in a crate and works with workspaces. A `rustfmt.toml` or `.rustfmt.toml` file can hold configuration, including stable and nightly-only options. For automated checks, `--check` returns code 0 when no formatting changes are needed and code 1 when changes would be made; it can be used in CI to fail a build on formatting differences. The README lists editor use with Vim, Emacs, Sublime Text 3, Atom, Visual Studio Code, IntelliJ, and CLion. Rustfmt is available on Windows, macOS, and Linux, and is distributed under the MIT License and Apache License 2.0. It does not attempt to format comments, and listed limitations also involve macros, unparsable code, fragments, and non-ASCII Unicode. Unstable settings require opt-in on nightly, and the README says the latest version requires the nightly toolchain.