Section: Formatting, linting, cleaning

Format source code

bash
bash
cargo fmt
Explanation

Requires the rustfmt component to be installed.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Formatting, linting, cleaning
Check formatting in CI
Fail if files are not formatted.
OpenIn sheetbashsame section
Run Clippy lints
Analyze code for common mistakes and style issues.
OpenIn sheetbashsame section
Treat warnings as errors
Fail the lint run on warnings.
OpenIn sheetbashsame section
Remove build artifacts
Delete the `target` directory for the package.
OpenIn sheetbashsame section
Type-check without producing binaries
Validate code quickly without final artifacts.
OpenIn sheetbash1 tag match
Run the test suite
Build and run tests for the local package.
OpenIn sheetbash1 tag match