Skip to content

Commit 49a027f

Browse files
committed
ci: add clippy core guard and clear clippy debt in core crates
1 parent 71226f7 commit 49a027f

27 files changed

Lines changed: 74 additions & 56 deletions

File tree

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,23 @@ jobs:
196196
- name: Check (workspace, locked)
197197
run: cargo check --workspace --locked
198198

199+
clippy-core-fast:
200+
name: clippy core crates (fast)
201+
runs-on: ubuntu-latest
202+
203+
steps:
204+
- name: Checkout
205+
uses: actions/checkout@v4
206+
207+
- name: Install Rust
208+
uses: dtolnay/rust-toolchain@stable
209+
210+
- name: Rust cache
211+
uses: Swatinem/rust-cache@v2
212+
213+
- name: Clippy (core crates, all targets)
214+
run: cargo clippy -p rexos-tools -p rexos-llm -p rexos-kernel --all-targets --locked -- -D warnings
215+
199216
docs:
200217
name: docs build
201218
runs-on: ubuntu-latest

crates/rexos-kernel/src/config.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -159,20 +159,12 @@ impl Default for SkillsConfig {
159159
}
160160
}
161161

162-
#[derive(Debug, Clone, Serialize, Deserialize)]
162+
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
163163
#[serde(default)]
164164
struct SkillsConfigWrapper {
165165
skills: SkillsConfig,
166166
}
167167

168-
impl Default for SkillsConfigWrapper {
169-
fn default() -> Self {
170-
Self {
171-
skills: SkillsConfig::default(),
172-
}
173-
}
174-
}
175-
176168
impl RexosConfig {
177169
pub fn ensure_default(paths: &RexosPaths) -> anyhow::Result<()> {
178170
storage::ensure_default_config(paths)

crates/rexos-kernel/src/security.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,11 @@ pub struct EgressConfig {
5959
pub rules: Vec<EgressRule>,
6060
}
6161

62-
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
62+
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Default)]
6363
#[serde(default)]
6464
pub struct EgressRule {
6565
pub tool: String,
6666
pub host: String,
6767
pub path_prefix: String,
6868
pub methods: Vec<String>,
6969
}
70-
71-
impl Default for EgressRule {
72-
fn default() -> Self {
73-
Self {
74-
tool: String::new(),
75-
host: String::new(),
76-
path_prefix: String::new(),
77-
methods: Vec::new(),
78-
}
79-
}
80-
}

crates/rexos-llm/src/anthropic/driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl AnthropicDriver {
3232
}
3333

3434
impl LlmDriver for AnthropicDriver {
35-
fn chat<'a>(&'a self, req: ChatCompletionRequest) -> ChatFuture<'a> {
35+
fn chat(&self, req: ChatCompletionRequest) -> ChatFuture<'_> {
3636
Box::pin(async move {
3737
let anthropic_req = build_request(req)?;
3838

crates/rexos-llm/src/bedrock/driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ impl BedrockDriver {
7878
}
7979

8080
impl LlmDriver for BedrockDriver {
81-
fn chat<'a>(&'a self, req: ChatCompletionRequest) -> ChatFuture<'a> {
81+
fn chat(&self, req: ChatCompletionRequest) -> ChatFuture<'_> {
8282
Box::pin(async move {
8383
let model_id = self.model_id(&req.model);
8484
if model_id.is_empty() {

crates/rexos-llm/src/dashscope/driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl DashscopeDriver {
3131
}
3232

3333
impl LlmDriver for DashscopeDriver {
34-
fn chat<'a>(&'a self, req: ChatCompletionRequest) -> ChatFuture<'a> {
34+
fn chat(&self, req: ChatCompletionRequest) -> ChatFuture<'_> {
3535
Box::pin(async move {
3636
let dash_req = DashscopeRequest {
3737
model: req.model,

crates/rexos-llm/src/driver.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::openai_compat::{ChatCompletionRequest, ChatMessage, OpenAiCompatibleC
99
pub type ChatFuture<'a> = Pin<Box<dyn Future<Output = anyhow::Result<ChatMessage>> + Send + 'a>>;
1010

1111
pub trait LlmDriver: Send + Sync {
12-
fn chat<'a>(&'a self, req: ChatCompletionRequest) -> ChatFuture<'a>;
12+
fn chat(&self, req: ChatCompletionRequest) -> ChatFuture<'_>;
1313
}
1414

1515
#[derive(Clone)]
@@ -26,7 +26,7 @@ impl OpenAiCompatDriver {
2626
}
2727

2828
impl LlmDriver for OpenAiCompatDriver {
29-
fn chat<'a>(&'a self, req: ChatCompletionRequest) -> ChatFuture<'a> {
29+
fn chat(&self, req: ChatCompletionRequest) -> ChatFuture<'_> {
3030
Box::pin(async move { self.client.chat_completions(req).await })
3131
}
3232
}
@@ -45,7 +45,7 @@ impl UnimplementedDriver {
4545
}
4646

4747
impl LlmDriver for UnimplementedDriver {
48-
fn chat<'a>(&'a self, _req: ChatCompletionRequest) -> ChatFuture<'a> {
48+
fn chat(&self, _req: ChatCompletionRequest) -> ChatFuture<'_> {
4949
Box::pin(async move { bail!("provider not implemented: {}", self.provider) })
5050
}
5151
}

crates/rexos-llm/src/gemini/driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl GeminiDriver {
3232
}
3333

3434
impl LlmDriver for GeminiDriver {
35-
fn chat<'a>(&'a self, req: ChatCompletionRequest) -> ChatFuture<'a> {
35+
fn chat(&self, req: ChatCompletionRequest) -> ChatFuture<'_> {
3636
Box::pin(async move {
3737
let gemini_req = build_request(&req)?;
3838

crates/rexos-llm/src/minimax/driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl MiniMaxDriver {
3131
}
3232

3333
impl LlmDriver for MiniMaxDriver {
34-
fn chat<'a>(&'a self, req: ChatCompletionRequest) -> ChatFuture<'a> {
34+
fn chat(&self, req: ChatCompletionRequest) -> ChatFuture<'_> {
3535
Box::pin(async move {
3636
let tool_choice = if req.tools.is_empty() {
3737
"none".to_string()

crates/rexos-llm/src/registry/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fn secret_resolver_reads_provider_key_from_env() {
3030
security: Default::default(),
3131
};
3232

33-
let resolver = SecretResolver::default();
33+
let resolver = SecretResolver;
3434
assert_eq!(
3535
resolver.resolve_provider_api_key(&cfg, "anthropic"),
3636
Some("test-secret".to_string())
@@ -43,7 +43,7 @@ fn secret_resolver_reads_provider_key_from_env() {
4343
fn secret_resolver_returns_none_for_blank_env_name() {
4444
use rexos_kernel::secrets::SecretResolver;
4545

46-
let resolver = SecretResolver::default();
46+
let resolver = SecretResolver;
4747
assert_eq!(resolver.resolve_env(""), None);
4848
}
4949

0 commit comments

Comments
 (0)