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