Ruff vs rustfmt
Ruff
docs.astral.shrustfmt
rust-lang.github.ioSide by side
| Figure | Ruff | rustfmt |
|---|---|---|
| Price from | Free | Free |
| Free plan | Yes | Yes |
| Free trial | — | — |
| Open source | — | — |
| Web | Yes | — |
| Windows | Yes | Yes |
| macOS | Yes | Yes |
| Linux | Yes | Yes |
| Self-hosted | Yes | — |
| Plans published | 1 | 1 |
| Spec score · Code formatters | 7.8 (#7) | 7.9 (#4) |
| Spec score · Code Formatting Tools | 7.9 (#12) | 8.0 (#10) |
| Configuration | Ruff supports configuration through pyproject.toml, ruff.toml, or .ruff.toml. | Configuration can be set in `rustfmt.toml` or `.rustfmt.toml`, and the default style conforms to the Rust style guide. |
| Editor integrations | The setup guide documents integrations including VS Code, Sublime Text, PyCharm, and Zed. | The README lists integrations or usage instructions for Vim, Emacs, Sublime Text 3, Atom, Visual Studio Code, and IntelliJ or CLion. |
| Purpose | Ruff is a Python linter and code formatter written in Rust. | rustfmt formats Rust code according to style guidelines. |
| Support | The editor setup documentation says setup instructions are provided on a best-effort basis and directs users to open an issue for assistance. | The README points users to `rustfmt --help` and `cargo fmt --help` for command usage and arguments. |
Plans
In their own words
Ruff
Ruff is a Python linter and code formatter written in Rust, available free under a permissive open-source license. It includes more than 900 built-in lint rules, including native versions of popular Flake8 plugin rules, and can automatically correct violations such as unused imports. Its formatter aims to serve as a replacement for Black, though the documentation allows for differences in some cases. The built-in Ruff Language Server supplies diagnostics, fixes, and formatting; the documentation recommends pairing it with another Python language server for navigation and autocompletion. Setup guidance covers VS Code, Sublime Text, PyCharm, and Zed, while CI support includes GitHub Actions, GitLab CI/CD, and pre-commit hooks. Ruff can be installed through uv, pip, pipx, standalone installers, Homebrew, Conda, and other package managers. It supports configuration in pyproject.toml, ruff.toml, or .ruff.toml. A Bandit-derived rule group checks for common Python security issues. Ruff runs on Linux, macOS, and Windows, and is also published as a Docker image. The maker describes it as 10–100x faster than tools such as Flake8 and Black.
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.