Skip to content

Commit

Permalink
docs: disallow missing docs on crate level and allow where necessary (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm authored Sep 26, 2024
1 parent 2646eeb commit 149062c
Show file tree
Hide file tree
Showing 17 changed files with 75 additions and 8 deletions.
4 changes: 4 additions & 0 deletions src/cockroach_db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ pub struct CockroachDb {
}

impl CockroachDb {
// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[allow(missing_docs)]
pub fn new(cmd: CockroachDbCmd) -> Self {
CockroachDb { cmd }
}
}

// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[allow(missing_docs)]
#[derive(Debug, Clone, Copy)]
pub enum CockroachDbCmd {
StartSingleNode { insecure: bool },
Expand Down
2 changes: 2 additions & 0 deletions src/consul/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ pub struct Consul {
}

impl Consul {
// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[allow(missing_docs)]
pub fn with_local_config(self, config: String) -> Self {
let mut env_vars = self.env_vars;
env_vars.insert(CONSUL_LOCAL_CONFIG.to_owned(), config);
Expand Down
2 changes: 2 additions & 0 deletions src/dynamodb_local/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ const NAME: &str = "amazon/dynamodb-local";
const TAG: &str = "2.0.0";
const DEFAULT_WAIT: u64 = 3000;

#[allow(missing_docs)]
// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[derive(Default, Debug, Clone)]
pub struct DynamoDb {
/// (remove if there is another variable)
Expand Down
2 changes: 2 additions & 0 deletions src/elastic_search/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ pub const ELASTICSEARCH_API_PORT: ContainerPort = ContainerPort::Tcp(9200);
/// [`Elasticsearch`]: https://elastic.co/
pub const ELASTICSEARCH_INTER_NODE_PORT: ContainerPort = ContainerPort::Tcp(9300);

#[allow(missing_docs)]
// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[derive(Debug, Default, Clone)]
pub struct ElasticSearch {
/// (remove if there is another variable)
Expand Down
2 changes: 2 additions & 0 deletions src/elasticmq/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ use testcontainers::{core::WaitFor, Image};
const NAME: &str = "softwaremill/elasticmq";
const TAG: &str = "1.5.2";

#[allow(missing_docs)]
// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[derive(Debug, Default, Clone)]
pub struct ElasticMq {
/// (remove if there is another variable)
Expand Down
16 changes: 16 additions & 0 deletions src/google_cloud_sdk_emulators/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,17 @@ pub const PUBSUB_PORT: u16 = 8085;
/// [`Spanner`]: https://cloud.google.com/spanner
pub const SPANNER_PORT: u16 = 9010;

#[allow(missing_docs)]
// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[derive(Debug, Clone)]
pub struct CloudSdkCmd {
pub host: String,
pub port: u16,
pub emulator: Emulator,
}

#[allow(missing_docs)]
// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[derive(Debug, Clone, Eq, PartialEq)]
pub enum Emulator {
Bigtable,
Expand Down Expand Up @@ -81,6 +85,8 @@ impl IntoIterator for &CloudSdkCmd {
}
}

#[allow(missing_docs)]
// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[derive(Debug, Clone)]
pub struct CloudSdk {
exposed_ports: Vec<ContainerPort>,
Expand Down Expand Up @@ -124,6 +130,8 @@ impl CloudSdk {
}
}

// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[allow(missing_docs)]
pub fn bigtable() -> Self {
Self::new(
BIGTABLE_PORT,
Expand All @@ -132,6 +140,8 @@ impl CloudSdk {
)
}

// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[allow(missing_docs)]
pub fn firestore() -> Self {
Self::new(
FIRESTORE_PORT,
Expand All @@ -140,6 +150,8 @@ impl CloudSdk {
)
}

// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[allow(missing_docs)]
pub fn datastore(project: impl Into<String>) -> Self {
let project = project.into();
Self::new(
Expand All @@ -149,6 +161,8 @@ impl CloudSdk {
)
}

// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[allow(missing_docs)]
pub fn pubsub() -> Self {
Self::new(
PUBSUB_PORT,
Expand All @@ -157,6 +171,8 @@ impl CloudSdk {
)
}

// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[allow(missing_docs)]
pub fn spanner() -> Self {
Self::new(
SPANNER_PORT, // gRPC port
Expand Down
8 changes: 8 additions & 0 deletions src/k3s/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,16 @@ pub struct K3s {
cmd: K3sCmd,
}

#[allow(missing_docs)]
// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[derive(Debug, Clone)]
pub struct K3sCmd {
snapshotter: String,
}

impl K3sCmd {
// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[allow(missing_docs)]
pub fn with_snapshotter(self, snapshotter: impl Into<String>) -> Self {
Self {
snapshotter: snapshotter.into(),
Expand Down Expand Up @@ -130,6 +134,8 @@ impl Image for K3s {
}

impl K3s {
// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[allow(missing_docs)]
pub fn with_conf_mount(mut self, conf_mount_path: impl AsRef<Path>) -> Self {
self.env_vars
.insert(String::from("K3S_KUBECONFIG_MODE"), String::from("644"));
Expand All @@ -142,6 +148,8 @@ impl K3s {
}
}

// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[allow(missing_docs)]
pub fn read_kube_config(&self) -> io::Result<String> {
let k3s_conf_file_path = self
.conf_mount
Expand Down
2 changes: 2 additions & 0 deletions src/kafka/confluent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ pub const KAFKA_PORT: ContainerPort = ContainerPort::Tcp(9093);
/// [`Zookeeper`]: https://zookeeper.apache.org/
pub const ZOOKEEPER_PORT: ContainerPort = ContainerPort::Tcp(2181);

#[allow(missing_docs)]
// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[derive(Debug, Clone)]
pub struct Kafka {
env_vars: HashMap<String, String>,
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// let's document our code for other/future developers
#![deny(missing_docs)]
#![cfg_attr(docsrs, deny(rustdoc::broken_intra_doc_links))]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![doc(
Expand Down
10 changes: 10 additions & 0 deletions src/minio/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const TAG: &str = "RELEASE.2022-02-07T08-17-33Z";
const DIR: &str = "/data";
const CONSOLE_ADDRESS: &str = ":9001";

#[allow(missing_docs)]
// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[derive(Debug, Clone)]
pub struct MinIO {
env_vars: HashMap<String, String>,
Expand All @@ -29,10 +31,18 @@ impl Default for MinIO {
}
}

#[allow(missing_docs)]
// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[derive(Debug, Clone)]
pub struct MinIOServerCmd {
#[allow(missing_docs)]
// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
pub dir: String,
#[allow(missing_docs)]
// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
pub certs_dir: Option<String>,
#[allow(missing_docs)]
// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
pub json_log: bool,
}

Expand Down
17 changes: 10 additions & 7 deletions src/mongo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,32 @@ use testcontainers::{
const NAME: &str = "mongo";
const TAG: &str = "5.0.6";

#[derive(Debug, Clone)]
#[allow(missing_docs)]
// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[derive(Default, Debug, Clone)]
enum InstanceKind {
#[default]
Standalone,
ReplSet,
}

impl Default for InstanceKind {
fn default() -> Self {
Self::Standalone
}
}

#[allow(missing_docs)]
// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[derive(Default, Debug, Clone)]
pub struct Mongo {
kind: InstanceKind,
}

impl Mongo {
// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[allow(missing_docs)]
pub fn new() -> Self {
Self {
kind: InstanceKind::Standalone,
}
}
// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[allow(missing_docs)]
pub fn repl_set() -> Self {
Self {
kind: InstanceKind::ReplSet,
Expand Down
2 changes: 2 additions & 0 deletions src/mosquitto/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ use testcontainers::{core::WaitFor, Image};
const NAME: &str = "eclipse-mosquitto";
const TAG: &str = "2.0.18";

#[allow(missing_docs)]
// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[derive(Debug, Default, Clone)]
pub struct Mosquitto {
/// (remove if there is another variable)
Expand Down
2 changes: 2 additions & 0 deletions src/mssql_server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ pub struct MssqlServer {
impl MssqlServer {
const NAME: &'static str = "mcr.microsoft.com/mssql/server";
const TAG: &'static str = "2022-CU14-ubuntu-22.04";
/// Default Password for `MSSQL_SA_PASSWORD`.
/// If you want to set your own password, please use [`with_sa_password`]
pub const DEFAULT_SA_PASSWORD: &'static str = "yourStrong(!)Password";

/// Sets the password as `MSSQL_SA_PASSWORD`.
Expand Down
6 changes: 6 additions & 0 deletions src/nats/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,24 @@ pub struct Nats {
cmd: NatsServerCmd,
}

#[allow(missing_docs)]
// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[derive(Default, Debug, Clone)]
pub struct NatsServerCmd {
user: Option<String>,
pass: Option<String>,
}

impl NatsServerCmd {
// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[allow(missing_docs)]
pub fn with_user(mut self, user: &str) -> Self {
self.user = Some(user.to_owned());
self
}

// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[allow(missing_docs)]
pub fn with_password(mut self, password: &str) -> Self {
self.pass = Some(password.to_owned());
self
Expand Down
2 changes: 1 addition & 1 deletion src/neo4j/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub enum Neo4jLabsPlugin {
/// You can also use it to validate your graph against constraints expressed in [SHACL](https://www.w3.org/TR/shacl/) or to run basic inferencing.
/// Please see [their documentation](https://neo4j.com/labs/neosemantics/) for furhter details
NeoSemantics,
// Allows specifying other plugins
/// Allows specifying other plugins
Custom(String),
}

Expand Down
2 changes: 2 additions & 0 deletions src/orientdb/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ use testcontainers::{core::WaitFor, Image};
const NAME: &str = "orientdb";
const TAG: &str = "3.2.19";

#[allow(missing_docs)]
// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[derive(Debug, Default, Clone)]
pub struct OrientDb {
/// (remove if there is another variable)
Expand Down
2 changes: 2 additions & 0 deletions src/parity_parity/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ use testcontainers::{core::WaitFor, Image};
const NAME: &str = "parity/parity";
const TAG: &str = "v2.5.0";

#[allow(missing_docs)]
// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously
#[derive(Debug, Default, Clone)]
pub struct ParityEthereum {
/// (remove if there is another variable)
Expand Down

0 comments on commit 149062c

Please sign in to comment.