Skip to content

Commit 9305659

Browse files
committed
Book: Improve chapter on CI
Recommend the -Dwarnings and --all-targets/--all-features more strongly.
1 parent 1f11cd1 commit 9305659

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

book/src/continuous_integration/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Continuous Integration
22

3-
It is recommended to run Clippy on CI, preferably with `-Dwarnings`, so that
4-
Clippy lints prevent CI from passing.
3+
It is recommended to run Clippy on CI with `-Dwarnings`, so that Clippy lints
4+
prevent CI from passing. To enforce errors on warnings on all `cargo` commands
5+
not just `cargo clippy`, you can set the env var `RUSTFLAGS="-Dwarnings"`.
56

67
We recommend to use Clippy from the same toolchain, that you use for compiling
78
your crate for maximum compatibility. E.g. if your crate is compiled with the

book/src/continuous_integration/github_actions.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@ pre-installed. So all you have to do is to run `cargo clippy`.
66
```yml
77
on: push
88
name: Clippy check
9+
10+
# Make sure CI fails on all warnings, including Clippy lints
11+
env:
12+
RUSTFLAGS: "-Dwarnings"
13+
914
jobs:
1015
clippy_check:
1116
runs-on: ubuntu-latest
1217
steps:
1318
- uses: actions/checkout@v1
1419
- name: Run Clippy
15-
run: cargo clippy
20+
run: cargo clippy --all-targets --all-features
1621
```

0 commit comments

Comments
 (0)