]> git.lizzy.rs Git - rust.git/blobdiff - README.md
Tidy up and pass tests
[rust.git] / README.md
index 86dc4dd8d3003afda22098e410dcbb1557d8ddfd..5e4e1da9204bcd5c36ca63915469da18f8aef2de 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# rustfmt [![Build Status](https://travis-ci.org/rust-lang-nursery/rustfmt.svg)](https://travis-ci.org/rust-lang-nursery/rustfmt) [![Build Status](https://ci.appveyor.com/api/projects/status/github/rust-lang-nursery/rustfmt?svg=true)](https://ci.appveyor.com/project/nrc/rustfmt) [![crates.io](https://img.shields.io/crates/v/rustfmt-nightly.svg)](https://crates.io/crates/rustfmt-nightly)
+# rustfmt [![Build Status](https://travis-ci.org/rust-lang-nursery/rustfmt.svg)](https://travis-ci.org/rust-lang-nursery/rustfmt) [![Build Status](https://ci.appveyor.com/api/projects/status/github/rust-lang-nursery/rustfmt?svg=true)](https://ci.appveyor.com/project/nrc/rustfmt) [![crates.io](https://img.shields.io/crates/v/rustfmt-nightly.svg)](https://crates.io/crates/rustfmt-nightly) [![Travis Configuration Status](https://img.shields.io/travis/davidalber/rustfmt-travis.svg?label=travis%20example)](https://travis-ci.org/davidalber/rustfmt-travis)
 
 A tool for formatting Rust code according to style guidelines.
 
@@ -18,49 +18,34 @@ stable or beta Rust toolchains, you must use the Syntex version (which is likely
 to be a bit out of date). Version 0.1 of rustfmt-nightly is forked from version
 0.9 of the syntex branch.
 
+You can use rustfmt in Travis CI builds. We provide a minimal Travis CI
+configuration (see [here](#checking-style-on-a-ci-server)) and verify its status
+using another repository. The status of that repository's build is reported by
+the "travis example" badge above.
+
 
 ## Quick start
 
-Currently, you can use `rustfmt` on nightly and beta. Rust 1.24 stable will work,
-but we're not quite there yet!
+You can use `rustfmt` on Rust 1.24 and above.
 
 To install:
 
 ```
-rustup component add rustfmt-preview --toolchain=nightly
+rustup component add rustfmt-preview
 ```
 
-If `nightly` is your default toolchain, you can leave the `--toolchain` off.
-
 to run on a cargo project in the current working directory:
 
 ```
-cargo +nightly fmt
+cargo fmt
 ```
 
-If `nightly` is your default toolchain, you can leave off the `+nightly`.
-
 ## Installation
 
 ```
-rustup component add rustfmt-preview --toolchain=nightly
-```
-
-If you don't have a nightly toolchain, you can add it using rustup:
-
-```
-rustup install nightly
-```
-
-You can make the nightly toolchain the default by running:
-
-```
-rustup default nightly
+rustup component add rustfmt-preview
 ```
 
-If you choose not to do that you'll have to run rustfmt using `rustup run ...`
-or by adding `+nightly` to the cargo invocation.
-
 ## Installing from source
 
 To install from source, first checkout to the tag or branch you want to install, then issue
@@ -143,16 +128,14 @@ when a pull request contains unformatted code. Using `--write-mode=diff` instruc
 rustfmt to exit with an error code if the input is not formatted correctly.
 It will also print any found differences.
 
-A minimal Travis setup could look like this:
+A minimal Travis setup could look like this (requires Rust 1.24.0 or greater):
 
 ```yaml
 language: rust
 before_script:
-- rustup toolchain install nightly
-- rustup component add --toolchain nightly rustfmt-preview
-- which rustfmt || cargo install --force rustfmt-nightly
+- rustup component add rustfmt-preview
 script:
-- cargo +nightly fmt --all -- --write-mode=diff
+- cargo fmt --all -- --write-mode=diff
 - cargo build
 - cargo test
 ```