From e4dd247b6b9869b788a78de8ab4aa662b8a41279 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 16 Dec 2021 12:35:51 +0000 Subject: [PATCH] Adding clippy linter as GitHub action --- .github/workflows/clippy_check.yml | 12 ++++++++++++ .github/workflows/rust.yml | 1 + little_raft/tests/raft_stable.rs | 13 ++----------- little_raft/tests/raft_unstable.rs | 13 ++----------- 4 files changed, 17 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/clippy_check.yml diff --git a/.github/workflows/clippy_check.yml b/.github/workflows/clippy_check.yml new file mode 100644 index 0000000..8098d87 --- /dev/null +++ b/.github/workflows/clippy_check.yml @@ -0,0 +1,12 @@ +on: push +name: Clippy check +jobs: + clippy_check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + components: clippy + override: true diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 3c13d1b..f0a113c 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -20,3 +20,4 @@ jobs: run: cargo build --verbose - name: Run tests run: cargo test --verbose + diff --git a/little_raft/tests/raft_stable.rs b/little_raft/tests/raft_stable.rs index 25da832..389c0f8 100644 --- a/little_raft/tests/raft_stable.rs +++ b/little_raft/tests/raft_stable.rs @@ -246,10 +246,7 @@ fn run_arithmetic_operation_on_cluster( .lock() .unwrap() .pending_transitions - .push(ArithmeticOperation { - delta, - id, - }); + .push(ArithmeticOperation { delta, id }); transition_notifiers[cluster.id] .send(()) .expect("could not send transition notification"); @@ -335,13 +332,7 @@ fn run_replicas() { 3, ); - run_arithmetic_operation_on_cluster( - clusters.clone(), - state_machines, - transition_tx, - 3, - 4, - ); + run_arithmetic_operation_on_cluster(clusters.clone(), state_machines, transition_tx, 3, 4); halt_clusters(clusters); diff --git a/little_raft/tests/raft_unstable.rs b/little_raft/tests/raft_unstable.rs index 1202f42..09591f4 100644 --- a/little_raft/tests/raft_unstable.rs +++ b/little_raft/tests/raft_unstable.rs @@ -246,10 +246,7 @@ fn run_arithmetic_operation_on_cluster( .lock() .unwrap() .pending_transitions - .push(ArithmeticOperation { - delta, - id, - }); + .push(ArithmeticOperation { delta, id }); transition_notifiers[cluster.id] .send(()) .expect("could not send transition notification"); @@ -342,13 +339,7 @@ fn run_replicas() { 3, ); - run_arithmetic_operation_on_cluster( - clusters.clone(), - state_machines, - transition_tx, - 3, - 4, - ); + run_arithmetic_operation_on_cluster(clusters.clone(), state_machines, transition_tx, 3, 4); halt_clusters(clusters);