rustfmt is a tool that automatically rewrites Rust source code to adhere to a consistent and standardized style guide. It functions as both a code formatter for transforming source files and a style linter used to verify if code matches required formatting rules.
The system is configurable, allowing for the definition of custom formatting rules and language editions through configuration files to override default styles. It also supports selective formatting by using dedicated skip markers to prevent specific blocks of code from being modified.
The tool provides capabilities for both source code rewriting across project directories and style compliance verification to identify non-compliant source during automated builds.