Skip to content

Commit 56e0949

Browse files
committed
ci: enforce workspace clippy and clear lint debt
1 parent 49a027f commit 56e0949

19 files changed

Lines changed: 89 additions & 106 deletions

File tree

.github/workflows/ci.yml

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

199-
clippy-core-fast:
200-
name: clippy core crates (fast)
199+
clippy-workspace:
200+
name: clippy workspace (all targets)
201201
runs-on: ubuntu-latest
202202

203203
steps:
@@ -210,8 +210,8 @@ jobs:
210210
- name: Rust cache
211211
uses: Swatinem/rust-cache@v2
212212

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
213+
- name: Clippy (workspace, all targets)
214+
run: cargo clippy --workspace --all-targets --locked -- -D warnings
215215

216216
docs:
217217
name: docs build

crates/loopforge-cli/src/dispatch/mcp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use std::collections::BTreeMap;
2-
use std::path::PathBuf;
2+
use std::path::{Path, PathBuf};
33

44
use anyhow::{anyhow, Context};
55
use serde_json::Value;
@@ -135,7 +135,7 @@ async fn diagnose(
135135
}
136136

137137
fn build_mcp_diagnose_json(
138-
workspace: &PathBuf,
138+
workspace: &Path,
139139
session_id: &str,
140140
sanitized_config: Value,
141141
servers_json: Value,

crates/loopforge-cli/src/dispatch/session.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,11 @@ mod tests {
174174

175175
#[test]
176176
fn build_session_policy_json_includes_expected_keys() {
177-
let mut skill_policy = rexos::agent::SessionSkillPolicy::default();
178-
skill_policy.allowlist = vec!["alpha".to_string()];
179-
skill_policy.require_approval = true;
180-
skill_policy.auto_approve_readonly = false;
177+
let skill_policy = rexos::agent::SessionSkillPolicy {
178+
allowlist: vec!["alpha".to_string()],
179+
require_approval: true,
180+
auto_approve_readonly: false,
181+
};
181182

182183
let mcp_config_json =
183184
r#"{"servers":{"s1":{"command":"python","env":{"API_KEY":"secret"}}}}"#;

crates/rexos-runtime/src/agents_hands/agents/lifecycle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl AgentRuntime {
6363
out.push(record);
6464
}
6565
}
66-
Ok(serde_json::to_string(&out).context("serialize agent list")?)
66+
serde_json::to_string(&out).context("serialize agent list")
6767
}
6868

6969
pub(crate) fn agent_find(&self, query: &str) -> anyhow::Result<String> {
@@ -85,7 +85,7 @@ impl AgentRuntime {
8585
}
8686
}
8787

88-
Ok(serde_json::to_string(&out).context("serialize agent find")?)
88+
serde_json::to_string(&out).context("serialize agent find")
8989
}
9090

9191
pub(crate) fn agent_kill(&self, agent_id: &str) -> anyhow::Result<String> {

crates/rexos-runtime/src/agents_hands/hands/lifecycle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ impl AgentRuntime {
3838
})
3939
.collect();
4040

41-
Ok(serde_json::to_string(&out).context("serialize hand_list")?)
41+
serde_json::to_string(&out).context("serialize hand_list")
4242
}
4343

4444
pub(crate) fn hand_activate(&self, args: HandActivateToolArgs) -> anyhow::Result<String> {
@@ -131,7 +131,7 @@ impl AgentRuntime {
131131
.to_string());
132132
};
133133

134-
Ok(serde_json::to_string(&active).context("serialize hand_status")?)
134+
serde_json::to_string(&active).context("serialize hand_status")
135135
}
136136

137137
pub(crate) fn hand_deactivate(&self, instance_id: &str) -> anyhow::Result<String> {

crates/rexos-runtime/src/scheduling/cron.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl AgentRuntime {
4141

4242
pub(crate) fn cron_list(&self) -> anyhow::Result<String> {
4343
let jobs = self.cron_jobs_get()?;
44-
Ok(serde_json::to_string(&jobs).context("serialize cron_list")?)
44+
serde_json::to_string(&jobs).context("serialize cron_list")
4545
}
4646

4747
pub(crate) fn cron_cancel(&self, job_id: &str) -> anyhow::Result<String> {

crates/rexos-runtime/src/scheduling/runner.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ fn truncate_status(s: String) -> String {
121121
}
122122
out.push(ch);
123123
}
124-
out.push_str("…");
124+
out.push('…');
125125
out
126126
}
127127

@@ -165,7 +165,7 @@ impl AgentRuntime {
165165
if let Ok(schedule) = parse_schedule(&job.schedule) {
166166
let next = compute_initial_next_run_at(&schedule, now);
167167
let job_id = job.job_id.clone();
168-
let _ = self.cron_jobs_update(|jobs| {
168+
self.cron_jobs_update(|jobs| {
169169
if let Some(existing) = jobs.iter_mut().find(|j| j.job_id == job_id) {
170170
if existing.next_run_at.is_none() && existing.enabled {
171171
existing.next_run_at = Some(next);
@@ -357,10 +357,10 @@ impl AgentRuntime {
357357
existing.last_status = Some(truncate_status(status.clone()));
358358
existing.consecutive_errors = 0;
359359

360-
let disable_after_success = match parse_schedule(&existing.schedule) {
361-
Ok(CronSchedule::At { .. }) => true,
362-
_ => false,
363-
};
360+
let disable_after_success = matches!(
361+
parse_schedule(&existing.schedule),
362+
Ok(CronSchedule::At { .. })
363+
);
364364
if existing.one_shot || disable_after_success {
365365
existing.enabled = false;
366366
existing.next_run_at = None;

crates/rexos-runtime/src/scheduling/schedules.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl AgentRuntime {
2929

3030
pub(crate) fn schedule_list(&self) -> anyhow::Result<String> {
3131
let schedules = self.schedules_get()?;
32-
Ok(serde_json::to_string(&schedules).context("serialize schedule_list")?)
32+
serde_json::to_string(&schedules).context("serialize schedule_list")
3333
}
3434

3535
pub(crate) fn schedule_delete(&self, id: &str) -> anyhow::Result<String> {

crates/rexos-runtime/src/session_runner/tool_dispatch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ mod parsing;
44
mod tasks_scheduling;
55
mod workflow_knowledge;
66

7-
use std::path::PathBuf;
7+
use std::path::Path;
88

99
use anyhow::Context;
1010
use rexos_kernel::router::TaskKind;
@@ -15,7 +15,7 @@ use crate::AgentRuntime;
1515
impl AgentRuntime {
1616
pub(super) async fn dispatch_runtime_tool_call(
1717
&self,
18-
workspace_root: &PathBuf,
18+
workspace_root: &Path,
1919
session_id: &str,
2020
kind: TaskKind,
2121
tools: &Toolset,

crates/rexos-runtime/src/session_runner/tool_dispatch/agents_hands.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::path::PathBuf;
1+
use std::path::Path;
22

33
use rexos_kernel::router::TaskKind;
44

@@ -11,7 +11,7 @@ use crate::AgentRuntime;
1111

1212
pub(super) async fn dispatch_agent_hand_tool(
1313
runtime: &AgentRuntime,
14-
workspace_root: &PathBuf,
14+
workspace_root: &Path,
1515
kind: TaskKind,
1616
tool_name: &str,
1717
args_json: &str,
@@ -50,7 +50,7 @@ pub(super) async fn dispatch_agent_hand_tool(
5050
let args: AgentSendToolArgs = parse_args(args_json, tool_name)?;
5151
Some(
5252
runtime
53-
.agent_send(workspace_root.clone(), kind, args)
53+
.agent_send(workspace_root.to_path_buf(), kind, args)
5454
.await
5555
.map_err(|err| err.context("agent_send"))?,
5656
)

0 commit comments

Comments
 (0)