Skip to content

Commit

Permalink
add clippy to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronKutch committed Apr 2, 2021
1 parent ddf6e3c commit dd376b1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,21 @@ jobs:
- uses: actions/checkout@v1
with:
submodules: true
- name: Install Rust
run: rustup update stable && rustup default stable && rustup component add rustfmt
- name: Install stable `rustfmt`
run: rustup set profile minimal && rustup default stable && rustup component add rustfmt
- run: cargo fmt -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
submodules: true
# Unlike rustfmt, stable clippy does not work on code with nightly features.
# This acquires the most recent nightly with a clippy component.
- name: Install nightly `clippy`
run: |
$CLIPPY_NIGHTLY="nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/clippy)"
rustup set profile minimal && rustup default "$CLIPPY_NIGHTLY" && rustup component add clippy
- run: cargo clippy -- -D clippy::all
3 changes: 3 additions & 0 deletions src/int/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ pub trait Int:
const FUZZ_NUM: usize;

fn unsigned(self) -> Self::UnsignedInt;

// It makes writing macros easier if this is implemented for both signed and unsigned
#[allow(clippy::wrong_self_convention)]
fn from_unsigned(unsigned: Self::UnsignedInt) -> Self;

fn from_bool(b: bool) -> Self;
Expand Down

0 comments on commit dd376b1

Please sign in to comment.