File tree Expand file tree Collapse file tree 6 files changed +20
-4
lines changed Expand file tree Collapse file tree 6 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 8888 - name : Build and run tests (+ GUI)
8989 run : cargo test --locked --target x86_64-unknown-linux-gnu --test gui
9090
91+ # Ensure there are no clippy warnings
92+ clippy :
93+ runs-on : ubuntu-latest
94+ steps :
95+ - uses : actions/checkout@v4
96+ - name : Install Rust
97+ run : bash ci/install-rust.sh stable x86_64-unknown-linux-gnu
98+ - run : rustup component add clippy
99+ - run : cargo clippy --workspace --all-targets --no-deps -- -D warnings
100+
91101 # The success job is here to consolidate the total success/failure state of
92102 # all other jobs. This job is then included in the GitHub branch protection
93103 # rule which prevents merges unless all other jobs are passing. This makes
@@ -101,6 +111,7 @@ jobs:
101111 - rustfmt
102112 - aarch64-cross-builds
103113 - gui
114+ - clippy
104115 runs-on : ubuntu-latest
105116 steps :
106117 - run : jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
Original file line number Diff line number Diff line change 11[workspace ]
22members = [" ." , " examples/remove-emphasis/mdbook-remove-emphasis" ]
33
4+ [workspace .lints .clippy ]
5+ all = { level = " allow" , priority = -2 }
6+ correctness = { level = " warn" , priority = -1 }
7+ complexity = { level = " warn" , priority = -1 }
8+ needless-lifetimes = " allow" # Remove once 1.87 is stable, https://github.com/rust-lang/rust-clippy/issues/13514
9+
410[package ]
511name = " mdbook"
612version = " 0.4.48"
@@ -91,3 +97,6 @@ test = false
9197name = " gui"
9298path = " tests/gui/runner.rs"
9399crate-type = [" bin" ]
100+
101+ [lints ]
102+ workspace = true
Original file line number Diff line number Diff line change 55//!
66//! [1]: ../index.html
77
8- #[ allow( clippy:: module_inception) ]
98mod book;
109mod init;
1110mod summary;
Original file line number Diff line number Diff line change @@ -148,7 +148,6 @@ enum RangeOrAnchor {
148148}
149149
150150// A range of lines specified with some include directive.
151- #[ allow( clippy:: enum_variant_names) ] // The prefix can't be removed, and is meant to mirror the contained type
152151#[ derive( PartialEq , Debug , Clone ) ]
153152enum LineRange {
154153 Range ( Range < usize > ) ,
Original file line number Diff line number Diff line change @@ -207,7 +207,6 @@ impl HtmlHandlebars {
207207 Ok ( ( ) )
208208 }
209209
210- #[ allow( clippy:: let_and_return) ]
211210 fn post_process (
212211 & self ,
213212 rendered : String ,
Original file line number Diff line number Diff line change @@ -780,7 +780,6 @@ mod search {
780780 }
781781
782782 #[ test]
783- #[ allow( clippy:: float_cmp) ]
784783 fn book_creates_reasonable_search_index ( ) {
785784 let temp = DummyBook :: new ( ) . build ( ) . unwrap ( ) ;
786785 let md = MDBook :: load ( temp. path ( ) ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments