clang-format
5.5#28 in code formatting toolsExtensionLinuxmacOSWindows
Visit| Fact | clang-format | rustfmt |
|---|---|---|
| Configuration | Formatting styles can be set with command-line options or project-level .clang-format or _clang-format files. | Configuration can be set in `rustfmt.toml` or `.rustfmt.toml`, and the default style conforms to the Rust style guide. |
| Editor integrations | The documentation describes integrations for Vim, Emacs, BBEdit, CLion, Visual Studio, and Visual Studio Code. | The README lists integrations or usage instructions for Vim, Emacs, Sublime Text 3, Atom, Visual Studio Code, and IntelliJ or CLion. |
| License | LLVM releases are distributed under the Apache-2.0 license with LLVM exceptions, which the download page describes as OSI-approved. | rustfmt is distributed under both the MIT License and Apache License 2.0. |
| Purpose | ClangFormat is a set of tools built on LibFormat for formatting source code, available as a standalone tool and through editor integrations. | rustfmt formats Rust code according to style guidelines. |
| Support | The Clang guide directs users who encounter problems to file bugs on the LLVM bug tracker. | The README points users to `rustfmt --help` and `cargo fmt --help` for command usage and arguments. |
No prices published.
It suits developers who want consistent source formatting from a standalone tool or editor integration. Its style presets and project-level configuration support teams with established formatting rules.
rustfmt suits Rust developers who want consistent formatting through Cargo, an editor, or CI. It is also relevant to developers who need configurable formatting behavior.