Skip to content

Commit

Permalink
chore(offchain): suppress rust-clippy warnings
Browse files Browse the repository at this point in the history
Full list of warnings:
- avoid warning `large_enum_variant` from cargo clippy on `pub enum MachineOneof`, built from grpc-interfaces. More at https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant
- allow enum variants with same suffix. More at https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names.
- allow too many arguments in fn. More at https://rust-lang.github.io/rust-clippy/master/index.html#/too_many_arguments.
- allow capitalized acronym. More at https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms.
  • Loading branch information
marcelstanley authored and gligneul committed Jul 31, 2023
1 parent 313713b commit 32f27f3
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions offchain/advance-runner/src/server_manager/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use snafu::Snafu;

#[derive(Debug, Snafu)]
#[snafu(visibility(pub(super)))]
#[allow(clippy::enum_variant_names)]
pub enum ServerManagerError {
#[snafu(display("failed to connect to server-manager"))]
ConnectionError { source: tonic::transport::Error },
Expand Down
1 change: 1 addition & 0 deletions offchain/advance-runner/src/snapshot/fs_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use super::config::FSManagerConfig;
use super::{Snapshot, SnapshotManager};

#[derive(Debug, Snafu)]
#[allow(clippy::enum_variant_names)]
pub enum FSSnapshotError {
#[snafu(display("failed to follow latest symlink"))]
ReadLinkError { source: std::io::Error },
Expand Down
2 changes: 2 additions & 0 deletions offchain/clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This avoids warning `large_enum_variant` on `pub enum MachineOneof`, built from grpc-interfaces.
enum-variant-size-threshold = 2500
1 change: 1 addition & 0 deletions offchain/dispatcher/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ pub struct AuthEnvCLIConfig {
}

#[derive(Debug, Clone)]
#[allow(clippy::upper_case_acronyms)]
pub enum AuthConfig {
Mnemonic {
mnemonic: String,
Expand Down
1 change: 1 addition & 0 deletions offchain/dispatcher/src/dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ pub async fn start(
}

#[instrument(level = "trace", skip_all)]
#[allow(clippy::too_many_arguments)]
async fn process_block(
block: &Block,

Expand Down
1 change: 1 addition & 0 deletions offchain/state-server/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use url::ParseError;

#[derive(Debug, Snafu)]
#[snafu(visibility(pub(crate)))]
#[allow(clippy::enum_variant_names)]
pub enum StateServerError {
#[snafu(display("tonic error"))]
TonicError { source: TonicError },
Expand Down

0 comments on commit 32f27f3

Please sign in to comment.