A tool for formatting Rust code according to style guidelines. You can use rustfmt in Travis CI builds. We provide a minimal Travis CI configuration (see here) and verify its status using another repository. You can run rustfmt with Rust 1.24 and above. Rustfmt tries to work on as much Rust code as possible. Sometimes, the code doesn't even need to compile! In general, we are looking to limit areas of instability; in particular, post-1.0, the formatting of most code should not change as Rustfmt improves. However, there are some things that Rustfmt can't do or can't do well (and thus where formatting might change significantly, even post-1.0). We would like to reduce the list of limitations over time. You can run Rustfmt by just typing rustfmt filename if you used cargo install. This runs rustfmt on the given file, if the file includes out of line modules, then we reformat those too.

Features

  • You can run rustfmt with Rust 1.24 and above
  • Verifying code is formatted
  • Run Rustfmt from your editor
  • Check style on a CI server
  • Rustfmt is designed to be very configurable
  • Rustfmt uses a style which conforms to the Rust style guide

Project Samples

Project Activity

See All Activity >

Categories

Data Formats

License

MIT License

Follow rustfmt

rustfmt Web Site

Other Useful Business Software
Full-stack observability with actually useful AI | Grafana Cloud Icon
Full-stack observability with actually useful AI | Grafana Cloud

Our generous forever free tier includes the full platform, including the AI Assistant, for 3 users with 10k metrics, 50GB logs, and 50GB traces.

Built on open standards like Prometheus and OpenTelemetry, Grafana Cloud includes Kubernetes Monitoring, Application Observability, Incident Response, plus the AI-powered Grafana Assistant. Get started with our generous free tier today.
Create free account
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of rustfmt!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

Rust

Related Categories

Rust Data Formats Software

Registered

2022-01-11