Skip to content
SPECIFICTION
Get listed

Ruff vs rustfmt

Ruff

docs.astral.sh

rustfmt

rust-lang.github.io

Side by side

FigureRuffrustfmt
Price fromFreeFree
Free planYesYes
Free trial——
Open source——
WebYes—
WindowsYesYes
macOSYesYes
LinuxYesYes
Self-hostedYes—
Plans published11
Spec score · Code formatters7.8 (#7)7.9 (#4)
Spec score · Code Formatting Tools7.9 (#12)8.0 (#10)
ConfigurationRuff 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 integrationsThe 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.
PurposeRuff is a Python linter and code formatter written in Rust.rustfmt formats Rust code according to style guidelines.
SupportThe 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

Ruff

  • RuffFree

Ruff pricing →

rustfmt

  • rustfmtFree

rustfmt pricing →

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.

Visit docs.astral.sh

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.

Visit rust-lang.github.io