Skip to content

Commit b6323a7

Browse files
committed
more clippy linting fixes
1 parent 06f6990 commit b6323a7

File tree

9 files changed

+21
-15
lines changed

9 files changed

+21
-15
lines changed

.github/workflows/vscode-extension.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ jobs:
3737
- name: Install dependencies
3838
run: npm ci
3939

40+
- name: Copy generated types
41+
run: npm run copy-types
42+
4043
- name: Lint
4144
run: npm run lint
4245

src/agents/agent_switcher.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ mod tests {
292292
use crate::agents::tmux::MockTmuxClient;
293293
use crate::config::{Config, Delegator};
294294
use crate::templates::schema::{PermissionMode, ReviewType, StepSchema};
295+
use std::collections::HashMap;
295296

296297
fn make_step(agent: Option<&str>) -> StepSchema {
297298
StepSchema {
@@ -327,7 +328,7 @@ mod tests {
327328
llm_tool: tool.to_string(),
328329
model: model.to_string(),
329330
display_name: None,
330-
model_properties: Default::default(),
331+
model_properties: HashMap::default(),
331332
launch_config: None,
332333
}
333334
}

src/agents/hooks/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ mod tests {
226226
let signal = signal.unwrap();
227227
assert_eq!(signal.event, "stop");
228228
assert_eq!(signal.session_id, "test-session");
229-
assert_eq!(signal.timestamp, 1234567890);
229+
assert_eq!(signal.timestamp, 1_234_567_890);
230230
}
231231

232232
#[test]

src/agents/monitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ mod tests {
965965
std::fs::create_dir_all(&signal_dir).unwrap();
966966
let signal = HookSignal {
967967
event: "stop".to_string(),
968-
timestamp: 1234567890,
968+
timestamp: 1_234_567_890,
969969
session_id: agent_id.to_string(),
970970
};
971971
let signal_path = signal_dir.join(format!("{agent_id}.signal"));

src/api/anthropic.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,14 +252,14 @@ mod tests {
252252
#[test]
253253
fn test_rate_limit_info_summary() {
254254
let info = RateLimitInfo {
255-
input_tokens_limit: Some(100000),
255+
input_tokens_limit: Some(100_000),
256256
input_tokens_remaining: Some(87000),
257257
..Default::default()
258258
};
259259
assert_eq!(info.summary(), "87% input");
260260

261261
let info = RateLimitInfo {
262-
tokens_limit: Some(100000),
262+
tokens_limit: Some(100_000),
263263
tokens_remaining: Some(45000),
264264
..Default::default()
265265
};
@@ -275,7 +275,7 @@ mod tests {
275275
#[test]
276276
fn test_is_below_threshold() {
277277
let info = RateLimitInfo {
278-
input_tokens_limit: Some(100000),
278+
input_tokens_limit: Some(100_000),
279279
input_tokens_remaining: Some(15000), // 15%
280280
..Default::default()
281281
};
@@ -286,7 +286,7 @@ mod tests {
286286
#[test]
287287
fn test_tokens_remaining_pct() {
288288
let info = RateLimitInfo {
289-
tokens_limit: Some(100000),
289+
tokens_limit: Some(100_000),
290290
tokens_remaining: Some(50000),
291291
..Default::default()
292292
};

src/api/providers/ai/anthropic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ mod tests {
243243
let info = AnthropicProvider::parse_rate_limit_headers(&headers);
244244

245245
assert_eq!(info.provider, "anthropic");
246-
assert_eq!(info.tokens_limit, Some(100000));
246+
assert_eq!(info.tokens_limit, Some(100_000));
247247
assert_eq!(info.tokens_remaining, Some(75000));
248248
assert_eq!(info.input_tokens_limit, Some(50000));
249249
assert_eq!(info.input_tokens_remaining, Some(40000));

src/api/providers/ai/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,12 @@ mod tests {
155155
#[test]
156156
fn test_rate_limit_info_summary() {
157157
let mut info = RateLimitInfo::new("anthropic");
158-
info.input_tokens_limit = Some(100000);
158+
info.input_tokens_limit = Some(100_000);
159159
info.input_tokens_remaining = Some(87000);
160160
assert_eq!(info.summary(), "87% input");
161161

162162
let mut info = RateLimitInfo::new("openai");
163-
info.tokens_limit = Some(100000);
163+
info.tokens_limit = Some(100_000);
164164
info.tokens_remaining = Some(45000);
165165
assert_eq!(info.summary(), "45% tokens");
166166

@@ -173,7 +173,7 @@ mod tests {
173173
#[test]
174174
fn test_is_below_threshold() {
175175
let mut info = RateLimitInfo::new("anthropic");
176-
info.input_tokens_limit = Some(100000);
176+
info.input_tokens_limit = Some(100_000);
177177
info.input_tokens_remaining = Some(15000); // 15%
178178

179179
assert!(info.is_below_threshold(0.2)); // Below 20%

src/queue/watcher.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ impl QueueWatcher {
8686
#[cfg(test)]
8787
mod tests {
8888
use super::*;
89-
use notify::event::{AccessKind, CreateKind, DataChange, ModifyKind, RemoveKind};
89+
use notify::event::{
90+
AccessKind, CreateKind, DataChange, EventAttributes, ModifyKind, RemoveKind,
91+
};
9092
use notify::EventKind;
9193
use std::path::PathBuf;
9294
use tempfile::TempDir;
@@ -108,7 +110,7 @@ mod tests {
108110
Event {
109111
kind,
110112
paths: vec![path],
111-
attrs: Default::default(),
113+
attrs: EventAttributes::default(),
112114
}
113115
}
114116

@@ -187,7 +189,7 @@ mod tests {
187189
let event = Event {
188190
kind: EventKind::Create(CreateKind::File),
189191
paths: vec![],
190-
attrs: Default::default(),
192+
attrs: EventAttributes::default(),
191193
};
192194

193195
let result = watcher.classify_event(event);

tests/git_integration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ fn test_ticket_id() -> String {
9090
.duration_since(std::time::UNIX_EPOCH)
9191
.unwrap()
9292
.as_millis();
93-
format!("OPTEST-{}", timestamp % 100000)
93+
format!("OPTEST-{}", timestamp % 100_000)
9494
}
9595

9696
/// Get the path to the operator repository (current working directory)

0 commit comments

Comments
 (0)