From d843d18ee088b20e8caa7a6ed2d21772b7d97e44 Mon Sep 17 00:00:00 2001 From: Francisco Moura Date: Thu, 14 Sep 2023 14:50:44 -0300 Subject: [PATCH] fix: Fix help generation --- .github/workflows/rust-code-quality.yml | 11 +---------- offchain/advance-runner/src/config.rs | 3 ++- offchain/advance-runner/src/server_manager/config.rs | 4 ++-- offchain/advance-runner/src/snapshot/config.rs | 2 +- offchain/authority-claimer/src/config/cli.rs | 8 +++----- offchain/data/src/config.rs | 2 +- offchain/dispatcher/src/config.rs | 3 +-- offchain/graphql-server/src/config.rs | 3 ++- offchain/host-runner/src/config.rs | 3 ++- offchain/indexer/src/config.rs | 3 ++- offchain/inspect-server/src/config.rs | 3 ++- offchain/log/src/lib.rs | 3 +-- offchain/rollups-events/src/broker/mod.rs | 2 +- offchain/state-server/src/config.rs | 3 +-- 14 files changed, 22 insertions(+), 31 deletions(-) diff --git a/.github/workflows/rust-code-quality.yml b/.github/workflows/rust-code-quality.yml index bbfde7e25..a565be57d 100644 --- a/.github/workflows/rust-code-quality.yml +++ b/.github/workflows/rust-code-quality.yml @@ -19,16 +19,7 @@ jobs: with: submodules: recursive - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - offchain/target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: ${{ runner.os }}-cargo- + - name: Install protoc run: sudo apt update && sudo apt install -y protobuf-compiler libprotobuf-dev diff --git a/offchain/advance-runner/src/config.rs b/offchain/advance-runner/src/config.rs index 0aa8d5da6..9e2961850 100644 --- a/offchain/advance-runner/src/config.rs +++ b/offchain/advance-runner/src/config.rs @@ -62,7 +62,8 @@ pub enum ConfigError { SnapshotConfigError { source: SnapshotConfigError }, } -#[derive(Parser, Debug)] +#[derive(Debug, Parser)] +#[command(name = "advance_runner_config")] struct CLIConfig { #[command(flatten)] sm_cli_config: ServerManagerCLIConfig, diff --git a/offchain/advance-runner/src/server_manager/config.rs b/offchain/advance-runner/src/server_manager/config.rs index 5c98d9586..288f65b57 100644 --- a/offchain/advance-runner/src/server_manager/config.rs +++ b/offchain/advance-runner/src/server_manager/config.rs @@ -66,8 +66,8 @@ impl ServerManagerConfig { } } -#[derive(Parser, Debug)] -#[command(name = "server-manager")] +#[derive(Debug, Parser)] +#[command(name = "server_manager_config")] pub struct ServerManagerCLIConfig { /// Server-manager gRPC endpoint #[arg(long, env, default_value = "http://127.0.0.1:5001")] diff --git a/offchain/advance-runner/src/snapshot/config.rs b/offchain/advance-runner/src/snapshot/config.rs index 3b25d6d8d..01684e126 100644 --- a/offchain/advance-runner/src/snapshot/config.rs +++ b/offchain/advance-runner/src/snapshot/config.rs @@ -70,7 +70,7 @@ pub enum SnapshotConfigError { NoProviderEndpointError {}, } -#[derive(Parser, Debug)] +#[derive(Clone, Parser, Debug)] #[command(name = "snapshot")] pub struct SnapshotCLIConfig { /// If set to false, disables snapshots. Enabled by default diff --git a/offchain/authority-claimer/src/config/cli.rs b/offchain/authority-claimer/src/config/cli.rs index cb07cb787..8f8c243e7 100644 --- a/offchain/authority-claimer/src/config/cli.rs +++ b/offchain/authority-claimer/src/config/cli.rs @@ -25,9 +25,8 @@ use crate::config::{ // AuthorityClaimerCLI // ------------------------------------------------------------------------------------------------ -#[derive(Clone, Parser)] -#[command(name = "rd_config")] -#[command(about = "Configuration for rollups authority claimer")] +#[derive(Debug, Parser)] +#[command(name = "authority_claimer_config")] pub(crate) struct AuthorityClaimerCLI { #[command(flatten)] tx_manager_config: TxManagerCLIConfig, @@ -83,9 +82,8 @@ impl TryFrom for AuthorityClaimerConfig { // TxSigningConfig // ------------------------------------------------------------------------------------------------ -#[derive(Debug, Clone, Parser)] +#[derive(Debug, Parser)] #[command(name = "tx_signing_config")] -#[command(about = "Configuration for signing transactions")] pub(crate) struct TxSigningCLIConfig { /// Signer mnemonic, overrides `tx_signing_mnemonic_file` and `tx_signing_aws_kms_*` #[arg(long, env)] diff --git a/offchain/data/src/config.rs b/offchain/data/src/config.rs index fd3ddac05..f55e20d9e 100644 --- a/offchain/data/src/config.rs +++ b/offchain/data/src/config.rs @@ -30,7 +30,7 @@ impl RepositoryConfig { } } -#[derive(Parser)] +#[derive(Debug, Parser)] pub struct RepositoryCLIConfig { #[arg(long, env, default_value = "postgres")] postgres_user: String, diff --git a/offchain/dispatcher/src/config.rs b/offchain/dispatcher/src/config.rs index 4714d9121..aa09d08fd 100644 --- a/offchain/dispatcher/src/config.rs +++ b/offchain/dispatcher/src/config.rs @@ -22,9 +22,8 @@ use types::deployment_files::{ use crate::auth::{AuthConfig, AuthEnvCLIConfig, AuthError}; -#[derive(Clone, Parser)] +#[derive(Debug, Parser)] #[command(name = "rd_config")] -#[command(about = "Configuration for rollups dispatcher")] pub struct DispatcherEnvCLIConfig { #[command(flatten)] pub sc_config: SCEnvCLIConfig, diff --git a/offchain/graphql-server/src/config.rs b/offchain/graphql-server/src/config.rs index b3b2c44c5..081dad3bd 100644 --- a/offchain/graphql-server/src/config.rs +++ b/offchain/graphql-server/src/config.rs @@ -14,7 +14,8 @@ pub struct GraphQLConfig { pub healthcheck_port: u16, } -#[derive(Parser)] +#[derive(Debug, Parser)] +#[command(name = "graphql_server_config")] pub struct CLIConfig { #[command(flatten)] repository_config: RepositoryCLIConfig, diff --git a/offchain/host-runner/src/config.rs b/offchain/host-runner/src/config.rs index 447f4d98a..cada105c8 100644 --- a/offchain/host-runner/src/config.rs +++ b/offchain/host-runner/src/config.rs @@ -18,7 +18,8 @@ pub struct Config { pub healthcheck_port: u16, } -#[derive(Parser, Clone, Debug)] +#[derive(Debug, Parser)] +#[command(name = "host_runner_config")] pub struct CLIConfig { /// Logs Config #[command(flatten)] diff --git a/offchain/indexer/src/config.rs b/offchain/indexer/src/config.rs index 8b2fa18e0..8e1d4c39b 100644 --- a/offchain/indexer/src/config.rs +++ b/offchain/indexer/src/config.rs @@ -18,7 +18,8 @@ pub struct IndexerConfig { pub healthcheck_port: u16, } -#[derive(Parser)] +#[derive(Debug, Parser)] +#[command(name = "indexer_config")] pub struct CLIConfig { #[command(flatten)] repository_config: RepositoryCLIConfig, diff --git a/offchain/inspect-server/src/config.rs b/offchain/inspect-server/src/config.rs index ea725b247..7ec2dd597 100644 --- a/offchain/inspect-server/src/config.rs +++ b/offchain/inspect-server/src/config.rs @@ -35,7 +35,8 @@ pub struct InspectServerConfig { pub healthcheck_port: u16, } -#[derive(Parser)] +#[derive(Debug, Parser)] +#[command(name = "inspect_server_config")] pub struct CLIConfig { #[command(flatten)] pub log_config: LogEnvCliConfig, diff --git a/offchain/log/src/lib.rs b/offchain/log/src/lib.rs index cf857d1c1..4d4c36aa5 100644 --- a/offchain/log/src/lib.rs +++ b/offchain/log/src/lib.rs @@ -1,9 +1,8 @@ use clap::Parser; use tracing_subscriber::filter::{EnvFilter, LevelFilter}; -#[derive(Clone, Parser, Debug)] +#[derive(Debug, Parser)] #[command(name = "log_config")] -#[command(about = "Configuration for Logs")] pub struct LogEnvCliConfig { #[arg(long, env, default_value = "false")] pub log_enable_timestamp: bool, diff --git a/offchain/rollups-events/src/broker/mod.rs b/offchain/rollups-events/src/broker/mod.rs index 0108327ca..72b8e3fa4 100644 --- a/offchain/rollups-events/src/broker/mod.rs +++ b/offchain/rollups-events/src/broker/mod.rs @@ -326,7 +326,7 @@ pub enum BrokerError { InvalidPayload { source: serde_json::Error }, } -#[derive(Debug, Clone, Parser)] +#[derive(Debug, Parser)] #[command(name = "broker")] pub struct BrokerCLIConfig { /// Redis address diff --git a/offchain/state-server/src/config.rs b/offchain/state-server/src/config.rs index c8ddb691d..6d0fa4027 100644 --- a/offchain/state-server/src/config.rs +++ b/offchain/state-server/src/config.rs @@ -4,9 +4,8 @@ use eth_state_server_lib::config::{ }; use log::{LogConfig, LogEnvCliConfig}; -#[derive(Debug, Clone, Parser)] +#[derive(Debug, Parser)] #[command(name = "state_server_config")] -#[command(about = "Configuration for state-fold state-server")] pub struct EnvCLIConfig { #[command(flatten)] pub state_server_config: StateServerEnvCLIConfig,