Book: Improve chapter on CI
Recommend the -Dwarnings and --all-targets/--all-features more strongly.
This commit is contained in:
parent
1f11cd17ac
commit
9305659922
@ -1,7 +1,8 @@
|
|||||||
# Continuous Integration
|
# Continuous Integration
|
||||||
|
|
||||||
It is recommended to run Clippy on CI, preferably with `-Dwarnings`, so that
|
It is recommended to run Clippy on CI with `-Dwarnings`, so that Clippy lints
|
||||||
Clippy lints prevent CI from passing.
|
prevent CI from passing. To enforce errors on warnings on all `cargo` commands
|
||||||
|
not just `cargo clippy`, you can set the env var `RUSTFLAGS="-Dwarnings"`.
|
||||||
|
|
||||||
We recommend to use Clippy from the same toolchain, that you use for compiling
|
We recommend to use Clippy from the same toolchain, that you use for compiling
|
||||||
your crate for maximum compatibility. E.g. if your crate is compiled with the
|
your crate for maximum compatibility. E.g. if your crate is compiled with the
|
||||||
|
@ -6,11 +6,16 @@ pre-installed. So all you have to do is to run `cargo clippy`.
|
|||||||
```yml
|
```yml
|
||||||
on: push
|
on: push
|
||||||
name: Clippy check
|
name: Clippy check
|
||||||
|
|
||||||
|
# Make sure CI fails on all warnings, including Clippy lints
|
||||||
|
env:
|
||||||
|
RUSTFLAGS: "-Dwarnings"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
clippy_check:
|
clippy_check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- name: Run Clippy
|
- name: Run Clippy
|
||||||
run: cargo clippy
|
run: cargo clippy --all-targets --all-features
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user