Skip to content

Commit 915e958

Browse files
corvid-agentclaude
andcommitted
fix: resolve CI failures — cargo fmt + Windows-compatible temp dir
- Run cargo fmt to fix formatting issues across multiple files - Replace hardcoded "/tmp" with std::env::temp_dir() in root_flag_overrides_cwd test for Windows compatibility Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 41edf59 commit 915e958

5 files changed

Lines changed: 44 additions & 47 deletions

File tree

src/exports/kotlin.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@ pub fn extract_exports(content: &str) -> Vec<String> {
3535
}
3636

3737
if let Some(caps) = KT_DECL.captures(line)
38-
&& let Some(name) = caps.get(1) {
39-
// Skip companion objects (they're not standalone exports)
40-
if trimmed.starts_with("companion") {
41-
continue;
42-
}
43-
symbols.push(name.as_str().to_string());
38+
&& let Some(name) = caps.get(1)
39+
{
40+
// Skip companion objects (they're not standalone exports)
41+
if trimmed.starts_with("companion") {
42+
continue;
4443
}
44+
symbols.push(name.as_str().to_string());
45+
}
4546
}
4647

4748
symbols

src/exports/python.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@ static QUOTED: LazyLock<Regex> = LazyLock::new(|| Regex::new(r#"["'](\w+)["']"#)
1818
pub fn extract_exports(content: &str) -> Vec<String> {
1919
// Check for __all__ first
2020
if let Some(caps) = ALL_DECL.captures(content)
21-
&& let Some(list) = caps.get(1) {
22-
let mut symbols = Vec::new();
23-
for name_cap in QUOTED.captures_iter(list.as_str()) {
24-
if let Some(name) = name_cap.get(1) {
25-
symbols.push(name.as_str().to_string());
26-
}
21+
&& let Some(list) = caps.get(1)
22+
{
23+
let mut symbols = Vec::new();
24+
for name_cap in QUOTED.captures_iter(list.as_str()) {
25+
if let Some(name) = name_cap.get(1) {
26+
symbols.push(name.as_str().to_string());
2727
}
28-
return symbols;
2928
}
29+
return symbols;
30+
}
3031

3132
// Fallback: top-level def/class that don't start with _
3233
let mut symbols = Vec::new();

src/main.rs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -418,16 +418,17 @@ fn exit_with_status(
418418
}
419419

420420
if let Some(req) = require_coverage
421-
&& coverage.coverage_percent < req {
422-
println!(
423-
"\n{} {req}%: actual coverage is {}% ({} file(s) missing specs)",
424-
"--require-coverage".red(),
425-
coverage.coverage_percent,
426-
coverage.unspecced_files.len()
427-
);
428-
for f in &coverage.unspecced_files {
429-
println!(" {} {f}", "✗".red());
430-
}
431-
process::exit(1);
421+
&& coverage.coverage_percent < req
422+
{
423+
println!(
424+
"\n{} {req}%: actual coverage is {}% ({} file(s) missing specs)",
425+
"--require-coverage".red(),
426+
coverage.coverage_percent,
427+
coverage.unspecced_files.len()
428+
);
429+
for f in &coverage.unspecced_files {
430+
println!(" {} {f}", "✗".red());
432431
}
432+
process::exit(1);
433+
}
433434
}

src/parser.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ pub fn parse_frontmatter(content: &str) -> Option<ParsedSpec> {
2626
for line in yaml_block.lines() {
2727
// List item: " - value"
2828
if let Some(stripped) = line.trim_start().strip_prefix("- ")
29-
&& current_key.is_some() {
30-
current_list.push(stripped.trim().to_string());
31-
continue;
32-
}
29+
&& current_key.is_some()
30+
{
31+
current_list.push(stripped.trim().to_string());
32+
continue;
33+
}
3334

3435
// Key-value: "key: value" or "key:"
3536
if let Some(colon_pos) = line.find(':') {
@@ -58,10 +59,11 @@ pub fn parse_frontmatter(content: &str) -> Option<ParsedSpec> {
5859
// Blank or comment line: flush
5960
let trimmed = line.trim();
6061
if (trimmed.is_empty() || trimmed.starts_with('#'))
61-
&& let Some(prev_key) = current_key.take() {
62-
set_field(&mut fm, &prev_key, &current_list);
63-
current_list.clear();
64-
}
62+
&& let Some(prev_key) = current_key.take()
63+
{
64+
set_field(&mut fm, &prev_key, &current_list);
65+
current_list.clear();
66+
}
6567
}
6668

6769
// Flush trailing list

tests/integration.rs

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,9 @@ Utility functions.
255255
.arg(&root)
256256
.assert()
257257
.success()
258-
.stdout(predicate::str::contains("Export 'undocumented' not in spec"));
258+
.stdout(predicate::str::contains(
259+
"Export 'undocumented' not in spec",
260+
));
259261
}
260262

261263
#[test]
@@ -446,9 +448,7 @@ fn generate_no_op_when_fully_covered() {
446448
.arg(&root)
447449
.assert()
448450
.success()
449-
.stdout(predicate::str::contains(
450-
"No specs to generate",
451-
));
451+
.stdout(predicate::str::contains("No specs to generate"));
452452
}
453453

454454
// ─── 4. specsync init ───────────────────────────────────────────────────
@@ -643,7 +643,7 @@ fn root_flag_overrides_cwd() {
643643
.arg("check")
644644
.arg("--root")
645645
.arg(&root)
646-
.current_dir("/tmp")
646+
.current_dir(std::env::temp_dir())
647647
.assert()
648648
.success()
649649
.stdout(predicate::str::contains("specs checked"));
@@ -1022,11 +1022,7 @@ fn require_coverage_on_coverage_subcommand() {
10221022
let root = setup_minimal_project(&tmp);
10231023

10241024
// Add uncovered file
1025-
fs::write(
1026-
root.join("src/auth/extra.ts"),
1027-
"export function y() {}\n",
1028-
)
1029-
.unwrap();
1025+
fs::write(root.join("src/auth/extra.ts"), "export function y() {}\n").unwrap();
10301026

10311027
specsync()
10321028
.arg("coverage")
@@ -1064,11 +1060,7 @@ fn generate_with_multiple_languages() {
10641060
// Need at least one spec to avoid the "no spec files" early exit.
10651061
// Create a dummy specced module.
10661062
fs::create_dir_all(root.join("src/base")).unwrap();
1067-
fs::write(
1068-
root.join("src/base/base.ts"),
1069-
"export function base() {}\n",
1070-
)
1071-
.unwrap();
1063+
fs::write(root.join("src/base/base.ts"), "export function base() {}\n").unwrap();
10721064
fs::create_dir_all(root.join("specs/base")).unwrap();
10731065
let spec = valid_spec("base", &["src/base/base.ts"]);
10741066
fs::write(root.join("specs/base/base.spec.md"), spec).unwrap();

0 commit comments

Comments
 (0)