File tree Expand file tree Collapse file tree 6 files changed +59
-24
lines changed
Expand file tree Collapse file tree 6 files changed +59
-24
lines changed Original file line number Diff line number Diff line change 1313 - [ Pendantic] ( )
1414 - [ Nursery] ( )
1515 - [ Cargo] ( )
16+ - [ Continuous Integration] ( continuous_integration/README.md )
17+ - [ Travis CI] ( continuous_integration/travis.md )
18+ - [ GitHub Actions] ( continuous_integration/github_actions.md )
19+ - [ Gitlab] ( continuous_integration/gitlab.md )
1620- [ Development] ( development/README.md )
1721 - [ Basics] ( development/basics.md )
1822 - [ Adding Lints] ( development/adding_lints.md )
Original file line number Diff line number Diff line change 1+ # Continuous Integration
2+
3+ - [ Travis CI] ( travis.md )
4+ - [ Github Actions] ( github_actions.md )
5+ - [ Gitlab] ( gitlab.md )
Original file line number Diff line number Diff line change 1+ # GitHub Actions
2+
3+ ## actions-rs
4+
5+ An easy way to get started with adding Clippy to GitHub Actions is
6+ the [ actions-rs] ( https://github.com/actions-rs ) [ clippy-check] ( https://github.com/actions-rs/clippy-check ) :
7+
8+ ``` yml
9+ on : push
10+ name : Clippy check
11+ jobs :
12+ clippy_check :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - uses : actions/checkout@v1
16+ - name : Run Clippy
17+ run : cargo clippy
18+ ` ` `
Original file line number Diff line number Diff line change 1+ # Gitlab
2+
3+ *** placeholder***
Original file line number Diff line number Diff line change 1+ # Travis CI
2+
3+ You can add Clippy to Travis CI in the same way you use it locally:
4+
5+ ``` yml
6+ language : rust
7+ rust :
8+ - stable
9+ - beta
10+ before_script :
11+ - rustup component add clippy
12+ script :
13+ - cargo clippy
14+ # if you want the build job to fail when encountering warnings, use
15+ - cargo clippy -- -D warnings
16+ # in order to also check tests and non-default crate features, use
17+ - cargo clippy --all-targets --all-features -- -D warnings
18+ - cargo test
19+ # etc.
20+ ```
21+
22+ Note that adding ` -D warnings ` will cause your build to fail if ** any** warnings are found in your code.
23+ That includes warnings found by rustc (e.g. ` dead_code ` , etc.). If you want to avoid this and only cause
24+ an error for Clippy warnings, use ` #![deny(clippy::all)] ` in your code or ` -D clippy::all ` on the command
25+ line. (You can swap ` clippy::all ` with the specific lint category you are targeting.)
Original file line number Diff line number Diff line change @@ -81,28 +81,8 @@ clippy-driver --edition 2018 -Cpanic=abort foo.rs
8181
8282Note that ` rustc ` will still run, i.e. it will still emit the output files it normally does.
8383
84- ### Travis CI
85-
86- You can add Clippy to Travis CI in the same way you use it locally:
87-
88- ``` yml
89- language : rust
90- rust :
91- - stable
92- - beta
93- before_script :
94- - rustup component add clippy
95- script :
96- - cargo clippy
97- # if you want the build job to fail when encountering warnings, use
98- - cargo clippy -- -D warnings
99- # in order to also check tests and non-default crate features, use
100- - cargo clippy --all-targets --all-features -- -D warnings
101- - cargo test
102- # etc.
103- ```
84+ ### Continuous Integration
85+
86+ Adding Clippy to your continuous integration pipeline is a great way to automate the linting process. See the
87+ [ Continuous Integration] ( continuous_integration ) chapter for more information.
10488
105- Note that adding ` -D warnings ` will cause your build to fail if ** any** warnings are found in your code.
106- That includes warnings found by rustc (e.g. ` dead_code ` , etc.). If you want to avoid this and only cause
107- an error for Clippy warnings, use ` #![deny(clippy::all)] ` in your code or ` -D clippy::all ` on the command
108- line. (You can swap ` clippy::all ` with the specific lint category you are targeting.)
You can’t perform that action at this time.
0 commit comments