Skip to content

Commit dd376b1

Browse files
committed
add clippy to CI
1 parent ddf6e3c commit dd376b1

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

.github/workflows/main.yml

+17-2
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,21 @@ jobs:
109109
- uses: actions/checkout@v1
110110
with:
111111
submodules: true
112-
- name: Install Rust
113-
run: rustup update stable && rustup default stable && rustup component add rustfmt
112+
- name: Install stable `rustfmt`
113+
run: rustup set profile minimal && rustup default stable && rustup component add rustfmt
114114
- run: cargo fmt -- --check
115+
116+
clippy:
117+
name: Clippy
118+
runs-on: ubuntu-latest
119+
steps:
120+
- uses: actions/checkout@v1
121+
with:
122+
submodules: true
123+
# Unlike rustfmt, stable clippy does not work on code with nightly features.
124+
# This acquires the most recent nightly with a clippy component.
125+
- name: Install nightly `clippy`
126+
run: |
127+
$CLIPPY_NIGHTLY="nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/clippy)"
128+
rustup set profile minimal && rustup default "$CLIPPY_NIGHTLY" && rustup component add clippy
129+
- run: cargo clippy -- -D clippy::all

src/int/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ pub trait Int:
5959
const FUZZ_NUM: usize;
6060

6161
fn unsigned(self) -> Self::UnsignedInt;
62+
63+
// It makes writing macros easier if this is implemented for both signed and unsigned
64+
#[allow(clippy::wrong_self_convention)]
6265
fn from_unsigned(unsigned: Self::UnsignedInt) -> Self;
6366

6467
fn from_bool(b: bool) -> Self;

0 commit comments

Comments
 (0)