Merge pull request #3165 from phansch/cleanup_readme_for_clippy_preview_on_stable

Cleanup README for clippy-preview on stable
This commit is contained in:
Philipp Hansch 2018-09-13 19:06:26 +01:00 committed by GitHub
commit 75111def13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 56 deletions

View file

@ -45,7 +45,7 @@ subcommand.
#### Step 1: Install rustup
You can install [rustup](http://rustup.rs/) on supported platforms. This will help
us install clippy and its dependencies.
us install Clippy and its dependencies.
If you already have rustup installed, update to ensure you have the latest
rustup and compiler:
@ -54,26 +54,15 @@ rustup and compiler:
rustup update
```
#### Step 2: Install nightly toolchain
#### Step 2: Install Clippy
Rustup integration is still new, you will need a relatively new nightly (2018-07-15 or later).
To install Rust nightly with [rustup](https://rustup.rs/):
Once you have rustup and the latest stable release (at least Rust 1.29) installed, run the following command:
```terminal
rustup install nightly
rustup component add clippy-preview
```
#### Step 3: Install clippy
Once you have rustup and the nightly toolchain installed, run the following command:
```terminal
rustup component add clippy-preview --toolchain=nightly
```
Now you can run Clippy by invoking `cargo +nightly clippy`. If nightly is your
default toolchain in rustup, `cargo clippy` will work fine.
Now you can run Clippy by invoking `cargo clippy`.
### Running Clippy from the command line without installing it
@ -133,15 +122,6 @@ enable/disable Clippy lints until `tool_lints` are stable:
#![cfg_attr(feature = "cargo-clippy", allow(clippy_lint))]
```
## Updating rustc
Sometimes, rustc moves forward without Clippy catching up. Therefore updating
rustc may leave Clippy a non-functional state until we fix the resulting
breakage.
You can use the [rust-update](rust-update) script to update rustc only if
Clippy would also update correctly.
## License
Licensed under [MPL](https://www.mozilla.org/MPL/2.0/).

View file

@ -1,31 +0,0 @@
#!/bin/sh
if [ "$1" = '-h' ] ; then
echo 'Updates rustc & clippy'
echo 'It first checks if clippy would compile at current nightly and if so, it updates.'
echo 'Options:'
echo '-h: This help message'
echo '-f: Skips the check and just updates'
exit
fi
set -ex
renice -n 10 -p $$
export CARGO_INCREMENTAL=0
export RUSTFLAGS='-C target-cpu=native'
try_out() {
export RUSTUP_HOME=$HOME/.rustup-attempt
test -d $RUSTUP_HOME || (rustup toolchain add nightly && rustup default nightly)
rustup update
cargo +nightly install --force clippy
unset RUSTUP_HOME
export RUSTUP_HOME
}
[ "$1" = '-f' ] || try_out
rustup update
cargo +nightly install --force clippy