Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,14 @@ cargo-fmt:
- cargo +nightly fmt --all -- --check
allow_failure: true

cargo-clippy:
stage: test
<<: *docker-env
<<: *test-refs
script:
- ./.maintain/clippy.sh
allow_failure: true

cargo-check-benches:
stage: test
<<: *docker-env
Expand Down
11 changes: 11 additions & 0 deletions .maintain/clippy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env sh

# Script for building only the WASM binary of the given project.

set -e

SKIP_WASM_BUILD=1 cargo +nightly clippy -- \
-A clippy::all \
-D clippy::correctness \
-A clippy::if-same-then-else \
-A clippy::clone-double-ref
1 change: 1 addition & 0 deletions client/executor/src/wasm_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ pub fn create_wasm_runtime_with_code(
//
// We drop the cache_path here to silence warnings that cache_path is not used if
// compiling without the `wasmtime` flag.
#[allow(clippy::drop_copy)]
drop(cache_path);

sc_executor_wasmi::create_runtime(
Expand Down
1 change: 1 addition & 0 deletions client/executor/wasmtime/src/instance_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ impl InstanceWrapper {
/// See `[memory_as_slice]`. In addition to those requirements, since a mutable reference is
/// returned it must be ensured that only one mutable and no shared references to memory exists
/// at the same time.
#[allow(clippy::mut_from_ref)]
unsafe fn memory_as_slice_mut(&self) -> &mut [u8] {
let ptr = self.memory.data_ptr();
let len = self.memory.data_size();
Expand Down
1 change: 1 addition & 0 deletions client/network/src/block_request_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ struct SeenRequestsKey<B: BlockT> {
support_multiple_justifications: bool,
}

#[allow(clippy::derive_hash_xor_eq)]
impl<B: BlockT> Hash for SeenRequestsKey<B> {
fn hash<H: Hasher>(&self, state: &mut H) {
self.peer.hash(state);
Expand Down
1 change: 1 addition & 0 deletions client/network/src/state_request_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ struct SeenRequestsKey<B: BlockT> {
start: Vec<u8>,
}

#[allow(clippy::derive_hash_xor_eq)]
impl<B: BlockT> Hash for SeenRequestsKey<B> {
fn hash<H: Hasher>(&self, state: &mut H) {
self.peer.hash(state);
Expand Down