awesome-repositories.com
博客
awesome-repositories.com

通过 AI 驱动的搜索,发现最优秀的开源仓库。

探索精选搜索开源替代品自托管软件博客网站地图
项目关于排名机制媒体报道MCP 服务器
法律隐私政策服务条款
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
rust-lang avatar

rust-lang/rustfmt

0
View on GitHub↗
6,747 星标·987 分支·Rust·apache-2.0·8 次浏览rust-lang.github.io/rustfmt↗

Rustfmt

rustfmt is a Rust code formatter that operates as a Cargo subcommand, applying consistent formatting to Rust source files according to official style guidelines. It parses source code into a syntax tree, applies formatting rules to tree nodes, and pretty-prints the result back to text, with support for TOML-driven configuration that allows per-project style customization.

The formatter is edition-aware, automatically selecting formatting rules based on the Rust edition specified in the project, and supports a style edition override that decouples formatting rules from the Rust edition used for parsing. It includes a nightly style preview mechanism for testing upcoming formatting styles before they are stabilized, and a check-mode compliance enforcement that compares formatted output to original input, returning a non-zero exit code when differences exist.

The tool integrates with CI pipelines to enforce formatting compliance, failing builds automatically when pull request code does not match configured rules. It also supports editor integration for formatting Rust source files directly from within code editors, and can format all binary and library targets in a crate or workspace via a single cargo command.

Features

  • Code Formatting Tools - Applies consistent formatting to Rust source files according to official style guidelines and project configuration.
  • Source Code Formatters - Applies consistent formatting to Rust source files according to official style guidelines and project-specific configuration.
  • Rust Code Formatters - Applies consistent, project-wide formatting to Rust source files according to official style guidelines.
  • Cargo Subcommand Formatters - Integrates with Cargo as a subcommand to format all crate and workspace targets.
  • Cargo Subcommand Formatters - Runs formatting on all binary and library targets of a crate or workspace via cargo fmt.
  • Concrete Syntax Tree Generators - Parses source code into a concrete syntax tree for formatting and pretty-printing.
  • Cargo Subcommand Integrations - Integrates with Cargo to format all crate and workspace targets via a single command.
  • Cargo Workspace Formatters - Runs formatting across all targets in a Rust crate or workspace using a single cargo command.
  • CI Formatting Checks - Checks formatting compliance in automated pipelines and fails builds when code does not match style rules.
  • Source File Evaluation - Reads Rust source files and reformats them in place according to official style guidelines.
  • Editor Formatting Integrations - Integrates with popular editors to format Rust source files directly from the editing environment.
  • Edition-Aware Formatting Rules - Adjusts formatting rules to match the Rust edition specified in the project with optional style edition override.
  • Edition-Aware Formatting Selectors - Automatically selects formatting rules based on the Rust edition specified in the project.
  • Formatting Configurations - Reads formatting options from a TOML configuration file placed in the project or any parent directory.
  • Formatting Compliance Modes - Provides a check mode that exits with non-zero when formatting changes are needed.
  • TOML Configuration Support - Reads formatting options from a TOML configuration file for per-project style customization.
  • Edition-Specific Formatting Rules - Applies the default Rust formatting style that corresponds to the project's Rust edition, varying rules per edition.
  • Code Formatters - Official Rust code formatter.
  • Code Formatting - Official code formatter maintained by the core language team.
  • Rust Projects - Listed in the “Rust Projects” section of the Awesome For Beginners awesome list.
  • Static Analysis Tools - Formats Rust code to style guidelines.

Star 历史

rust-lang/rustfmt 的 Star 历史图表rust-lang/rustfmt 的 Star 历史图表

AI 搜索

探索更多 awesome 仓库

用简单的语言描述您的需求 —— AI 将根据相关性为您从数千个精选开源项目中进行排序。

Start searching with AI

Rustfmt 的开源替代方案

相似的开源项目,按与 Rustfmt 的功能重合度排序。
  • dprint/dprintdprint 的头像

    dprint/dprint

    3,795在 GitHub 上查看↗

    dprint is a multi-language code formatter that applies consistent styling across various programming languages using a pluggable architecture. It functions as a unified project style management tool, a command-line interface for continuous integration style enforcement, and a Language Server Protocol implementation for real-time formatting in editors. The project is distinguished by a WebAssembly-based plugin system that loads sandboxed formatting logic from URLs or file paths. It further extends its capabilities through a process-based tool integration that wraps external command-line interf

    Rustformatter
    在 GitHub 上查看↗3,795
  • nicklockwood/swiftformatnicklockwood 的头像

    nicklockwood/SwiftFormat

    8,835在 GitHub 上查看↗

    SwiftFormat is a tool for the Swift language that functions as a code formatter, linter, and refactoring utility. It automatically applies consistent style rules and visual formatting to source files to ensure a uniform appearance across a project. The project differentiates itself by providing both a command-line interface for batch processing and an Xcode extension for integration directly into the development environment. It includes specialized capabilities for modernizing legacy API usage, simplifying language constructs, and inferring formatting options by analyzing an existing codebase

    Swift
    在 GitHub 上查看↗8,835
  • google/yapfgoogle 的头像

    google/yapf

    13,978在 GitHub 上查看↗

    YAPF is a Python code formatter and style compliance tool. It operates as an AST-based reformatter that uses concrete syntax trees to ensure structural consistency and a uniform visual presentation across source files. The engine utilizes a penalty-based layout optimizer to determine the best line breaks by calculating numerical costs for different formatting choices. It employs a multi-process code processor to distribute the formatting of multiple files across several CPU cores. The tool covers source code reformatting through in-place file modifications, difference analysis, and the proce

    Python
    在 GitHub 上查看↗13,978
  • google/google-java-formatgoogle 的头像

    google/google-java-format

    6,145在 GitHub 上查看↗

    google-java-format is a Java code formatter and style enforcement tool. It reformats Java source code to adhere to a standardized style guide, ensuring consistent layout and indentation across entire projects or individual files. The project functions as a build pipeline linting tool for continuous integration workflows and as an IDE formatting plugin to replace native editor formatting. It can be embedded as a formatting library within code generation software to ensure machine-written output remains human-readable. The tool provides capabilities for reorganizing source code indentation and

    Java
    在 GitHub 上查看↗6,145
查看 Rustfmt 的所有 30 个替代方案→

常见问题解答

rust-lang/rustfmt 是做什么的?

rustfmt is a Rust code formatter that operates as a Cargo subcommand, applying consistent formatting to Rust source files according to official style guidelines. It parses source code into a syntax tree, applies formatting rules to tree nodes, and pretty-prints the result back to text, with support for TOML-driven configuration that allows per-project style customization.

rust-lang/rustfmt 的主要功能有哪些?

rust-lang/rustfmt 的主要功能包括:Code Formatting Tools, Source Code Formatters, Rust Code Formatters, Cargo Subcommand Formatters, Concrete Syntax Tree Generators, Cargo Subcommand Integrations, Cargo Workspace Formatters, CI Formatting Checks。

rust-lang/rustfmt 有哪些开源替代品?

rust-lang/rustfmt 的开源替代品包括: dprint/dprint — dprint is a multi-language code formatter that applies consistent styling across various programming languages using a… nicklockwood/swiftformat — SwiftFormat is a tool for the Swift language that functions as a code formatter, linter, and refactoring utility. It… google/yapf — YAPF is a Python code formatter and style compliance tool. It operates as an AST-based reformatter that uses concrete… google/google-java-format — google-java-format is a Java code formatter and style enforcement tool. It reformats Java source code to adhere to a… rust-lang-nursery/rustfmt — rustfmt is a tool that automatically rewrites Rust source code to adhere to a consistent and standardized style guide.… prabirshrestha/vim-lsp — vim-lsp is a Vim plugin that implements the Language Server Protocol to provide an asynchronous code intelligence tool…