Skip to content

Commit cdb0a91

Browse files
committed
fix(ci): resolve clippy lint violations in credentials/compute modules
- Backtick type names in doc comments (doc_markdown) - Change pub(crate) to pub for external module and connect fn (redundant_pub_crate) - Inline format args in credentials error messages (uninlined_format_args) - Flip if-not-else to positive condition (if_not_else) Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Paolo Dettori <dettori@us.ibm.com>
1 parent f58ee3b commit cdb0a91

5 files changed

Lines changed: 9 additions & 10 deletions

File tree

crates/openshell-server/src/cli.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,14 +278,14 @@ struct Args {
278278
oidc_scopes_claim: String,
279279

280280
/// Unix domain socket path to an external compute driver.
281-
/// Use with `--driver external` to delegate ComputeDriver RPCs to a
281+
/// Use with `--driver external` to delegate `ComputeDriver` RPCs to a
282282
/// pre-existing out-of-process driver (e.g. a sidecar container).
283283
#[arg(long, env = "OPENSHELL_COMPUTE_DRIVER_SOCKET")]
284284
compute_driver_socket: Option<PathBuf>,
285285

286286
/// Unix domain socket path to a credentials driver.
287287
/// When set, the gateway delegates credential resolution to this
288-
/// out-of-process driver via the CredentialsDriver gRPC contract.
288+
/// out-of-process driver via the `CredentialsDriver` gRPC contract.
289289
#[arg(long, env = "OPENSHELL_CREDENTIALS_DRIVER_SOCKET")]
290290
credentials_driver_socket: Option<PathBuf>,
291291
}

crates/openshell-server/src/compute/external.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use tower::service_fn;
2424
///
2525
/// Retries for up to 10 seconds to allow the sidecar time to start.
2626
#[cfg(unix)]
27-
pub(crate) async fn connect(socket_path: &std::path::Path) -> Result<Channel> {
27+
pub async fn connect(socket_path: &std::path::Path) -> Result<Channel> {
2828
let mut last_error: Option<String> = None;
2929
for _ in 0..100 {
3030
match connect_once(socket_path).await {

crates/openshell-server/src/compute/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
//! Gateway-owned compute orchestration over a pluggable compute backend.
55
6-
pub(crate) mod external;
6+
pub mod external;
77
pub mod vm;
88

99
pub use openshell_driver_docker::DockerComputeConfig;

crates/openshell-server/src/credentials.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ impl CredentialsDriverHandle {
5252
.await
5353
.map_err(|s| {
5454
Error::execution(format!(
55-
"credentials driver ResolveCredential failed for '{}': {}",
56-
name, s
55+
"credentials driver ResolveCredential failed for '{name}': {s}"
5756
))
5857
})?;
5958
Ok(response.into_inner())
@@ -66,7 +65,7 @@ impl CredentialsDriverHandle {
6665
.list_credentials(tonic::Request::new(ListCredentialsRequest {}))
6766
.await
6867
.map_err(|s| {
69-
Error::execution(format!("credentials driver ListCredentials failed: {}", s))
68+
Error::execution(format!("credentials driver ListCredentials failed: {s}"))
7069
})?;
7170
Ok(response.into_inner())
7271
}

crates/openshell-server/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,12 @@ pub async fn run_server(
207207
)
208208
.await?;
209209

210-
let credentials_driver = if !config.credentials_driver_socket.is_empty() {
210+
let credentials_driver = if config.credentials_driver_socket.is_empty() {
211+
None
212+
} else {
211213
let socket_path = std::path::Path::new(&config.credentials_driver_socket);
212214
let handle = credentials::CredentialsDriverHandle::connect(socket_path).await?;
213215
Some(Arc::new(handle))
214-
} else {
215-
None
216216
};
217217

218218
let state = Arc::new(ServerState::new(

0 commit comments

Comments
 (0)