Skip to content
13 changes: 13 additions & 0 deletions vdev/src/commands/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
#![allow(
// allows print! and println! in this module for commands to output to terminal
clippy::print_stdout,
// The cli_commands! macro generates exec() methods for all commands. Some commands
// use self while others don't, so we allow unused_self to avoid false warnings.
clippy::unused_self,
// All command exec() methods return Result<()> for consistency, even when they
// cannot fail. This allows uniform error handling across the command interface.
clippy::unnecessary_wraps,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, the macro cli_commands require these, as some of the implementations does require accessing self or returning an error. Because of that, I simply moved these so that it applies only for the commands module.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improved this in 53d486b.

Same can be done for unused_self and unnecessary_wraps.

)]

use clap::Parser;
use clap_verbosity_flag::{InfoLevel, Verbosity};

Expand Down
2 changes: 1 addition & 1 deletion vdev/src/commands/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn parse_env(env: Vec<String>) -> BTreeMap<String, Option<String>> {

impl Cli {
pub fn exec(self) -> Result<()> {
let runner = get_agent_test_runner(self.container)?;
let runner = get_agent_test_runner(self.container);

let mut args = vec!["--workspace".to_string()];

Expand Down
6 changes: 0 additions & 6 deletions vdev/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
#![deny(clippy::pedantic, warnings)]
#![allow(
clippy::module_name_repetitions,
clippy::print_stdout,
clippy::unused_self,
clippy::unnecessary_wraps
)]

#[macro_use]
mod macros;
Expand Down
2 changes: 1 addition & 1 deletion vdev/src/testing/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl ComposeTest {
runner_name,
&config.runner,
compose.is_some().then_some(network_name),
)?;
);

env_config.insert("VECTOR_IMAGE".to_string(), Some(runner.image_name()));

Expand Down
12 changes: 6 additions & 6 deletions vdev/src/testing/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ pub enum RunnerState {
Unknown,
}

pub fn get_agent_test_runner(container: bool) -> Result<Box<dyn TestRunner>> {
pub fn get_agent_test_runner(container: bool) -> Box<dyn TestRunner> {
if container {
Ok(Box::new(DockerTestRunner))
Box::new(DockerTestRunner)
} else {
Ok(Box::new(LocalTestRunner))
Box::new(LocalTestRunner)
}
}

Expand Down Expand Up @@ -274,7 +274,7 @@ impl IntegrationTestRunner {
integration: Option<String>,
config: &IntegrationRunnerConfig,
network: Option<String>,
) -> Result<Self> {
) -> Self {
let mut volumes: Vec<String> = config
.volumes
.iter()
Expand All @@ -283,12 +283,12 @@ impl IntegrationTestRunner {

volumes.push(format!("{VOLUME_TARGET}:/output"));

Ok(Self {
Self {
integration,
needs_docker_socket: config.needs_docker_socket,
network,
volumes,
})
}
}

pub(super) fn ensure_network(&self) -> Result<()> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ generated: components: sinks: greptimedb_logs: configuration: {
"""
required: false
type: object: {
examples: [{}]
examples: [{},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you run make generate-component-docs again?

]
options: "*": {
description: "Extra header key-value pairs."
required: true
Expand Down
Loading