Skip to content

Commit 0573284

Browse files
authored
Merge pull request #1444 from input-output-hk/djo/1439/missing_warn_missing_docs_in_client_cli
Warn missing docs directive missing in Mithril Client Cli
2 parents 27ded3e + 28eaed8 commit 0573284

File tree

17 files changed

+42
-43
lines changed

17 files changed

+42
-43
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,9 @@ jobs:
648648

649649
- name: Generate cargo doc
650650
run: |
651-
cargo doc --no-deps -p mithril-stm -p mithril-common -p mithril-aggregator \
651+
# Force `--lib` to avoid a collision between the client lib and the client cli binary who share
652+
# the same name (we only want to document those anyway)
653+
cargo doc --no-deps --lib -p mithril-stm -p mithril-common -p mithril-aggregator \
652654
-p mithril-signer -p mithril-client -p mithril-client-cli \
653655
--all-features --message-format=json \
654656
| clippy-sarif | tee rust-cargo-doc-results.sarif | sarif-fmt

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mithril-client-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-client-cli"
3-
version = "0.5.15"
3+
version = "0.5.16"
44
description = "A Mithril Client"
55
authors = { workspace = true }
66
edition = { workspace = true }

mithril-client-cli/src/commands/mithril_stake_distribution/download.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use std::{
88
sync::Arc,
99
};
1010

11+
use crate::{configuration::ConfigParameters, utils::ExpanderUtils};
1112
use mithril_client::{ClientBuilder, MessageBuilder};
12-
use mithril_client_cli::{configuration::ConfigParameters, utils::ExpanderUtils};
1313
use mithril_common::StdResult;
1414

1515
/// Download and verify a Mithril Stake Distribution information. If the

mithril-client-cli/src/commands/mithril_stake_distribution/list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use config::{builder::DefaultState, ConfigBuilder};
44
use slog_scope::logger;
55
use std::{collections::HashMap, sync::Arc};
66

7+
use crate::configuration::ConfigParameters;
78
use mithril_client::ClientBuilder;
8-
use mithril_client_cli::configuration::ConfigParameters;
99
use mithril_common::{test_utils::fake_keys, StdResult};
1010

1111
/// Mithril stake distribution LIST command

mithril-client-cli/src/commands/snapshot/download.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ use std::{
1010
sync::Arc,
1111
};
1212

13-
use mithril_client::{
14-
common::ProtocolMessage, Client, ClientBuilder, MessageBuilder, MithrilCertificate, Snapshot,
15-
};
16-
use mithril_client_cli::{
13+
use crate::{
1714
configuration::ConfigParameters,
1815
utils::{
1916
ExpanderUtils, IndicatifFeedbackReceiver, ProgressOutputType, ProgressPrinter,
2017
SnapshotUnpacker, SnapshotUtils,
2118
},
2219
};
20+
use mithril_client::{
21+
common::ProtocolMessage, Client, ClientBuilder, MessageBuilder, MithrilCertificate, Snapshot,
22+
};
2323
use mithril_common::StdResult;
2424

2525
/// Clap command to download the snapshot and verify the certificate.
@@ -59,7 +59,7 @@ impl SnapshotDownloadCommand {
5959
let progress_output_type = if self.json {
6060
ProgressOutputType::JsonReporter
6161
} else {
62-
ProgressOutputType::TTY
62+
ProgressOutputType::Tty
6363
};
6464
let progress_printer = ProgressPrinter::new(progress_output_type, 5);
6565
let client = ClientBuilder::aggregator(

mithril-client-cli/src/commands/snapshot/list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use config::{builder::DefaultState, ConfigBuilder};
44
use slog_scope::logger;
55
use std::{collections::HashMap, sync::Arc};
66

7+
use crate::configuration::ConfigParameters;
78
use mithril_client::ClientBuilder;
8-
use mithril_client_cli::configuration::ConfigParameters;
99
use mithril_common::{test_utils::fake_keys, StdResult};
1010

1111
/// Clap command to list existing snapshots

mithril-client-cli/src/commands/snapshot/show.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use config::{builder::DefaultState, ConfigBuilder};
55
use slog_scope::logger;
66
use std::{collections::HashMap, sync::Arc};
77

8+
use crate::{configuration::ConfigParameters, utils::ExpanderUtils};
89
use mithril_client::ClientBuilder;
9-
use mithril_client_cli::{configuration::ConfigParameters, utils::ExpanderUtils};
1010
use mithril_common::{test_utils::fake_keys, StdResult};
1111

1212
/// Clap command to show a given snapshot

mithril-client-cli/src/configuration.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ impl ConfigParameters {
2424
}
2525

2626
/// Useful constructor for testing
27+
#[cfg(test)]
2728
pub fn build(parameters: &[(&str, &str)]) -> Self {
2829
let parameters = parameters
2930
.iter()
@@ -34,6 +35,7 @@ impl ConfigParameters {
3435
}
3536

3637
/// Add or replace a parameter in the holder
38+
#[cfg(test)]
3739
pub fn add_parameter(&mut self, name: &str, value: &str) -> &mut Self {
3840
let _ = self.parameters.insert(name.to_string(), value.to_string());
3941

mithril-client-cli/src/lib.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
1-
pub mod configuration;
2-
pub mod utils;
1+
#![warn(missing_docs)]
2+
3+
//! A command line interface that uses the [Mithril Client Library](https://mithril.network/doc/manual/developer-docs/nodes/mithril-client-library)
4+
//! to manipulate Mithril certified types from a Mithril Aggregator:
5+
//! * Snapshots: List, Show, download and verify
6+
//! * Mithril Stake Distribution: List, download and verify
7+
//
8+
//! You can find more information on how it works reading the [documentation website](https://mithril.network/doc/mithril/mithril-network/client).
9+
10+
pub mod commands;
11+
mod configuration;
12+
mod utils;

0 commit comments

Comments
 (0)