Skip to content

Commit d8cba43

Browse files
committed
fix: formatting
1 parent 345bb64 commit d8cba43

3 files changed

Lines changed: 13 additions & 19 deletions

File tree

.capsec.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,8 @@ crate = "capsec-std"
66

77
[[allow]]
88
crate = "capsec-tokio"
9+
10+
# cargo-capsec is the CLI tool — it necessarily performs I/O to scan,
11+
# cache, and invoke the deep analysis driver.
12+
[[allow]]
13+
crate = "cargo-capsec"

crates/cargo-capsec/src/main.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ fn run_audit(args: AuditArgs) {
214214

215215
// ── Deep MIR analysis (runs before Phase 2 so findings feed into export maps) ──
216216
if args.deep {
217-
let output_path = std::env::temp_dir()
218-
.join(format!("capsec-deep-{}.jsonl", std::process::id()));
217+
let output_path =
218+
std::env::temp_dir().join(format!("capsec-deep-{}.jsonl", std::process::id()));
219219

220220
let driver_available = capsec_std::process::command("which", &spawn_cap)
221221
.ok()
@@ -278,18 +278,16 @@ fn run_audit(args: AuditArgs) {
278278

279279
match deep_result {
280280
Some(output) if output.status.success() || output_path.exists() => {
281-
if let Ok(contents) =
282-
capsec_std::fs::read_to_string(&output_path, &fs_read)
281+
if let Ok(contents) = capsec_std::fs::read_to_string(&output_path, &fs_read)
283282
{
284283
for line in contents.lines() {
285284
if line.trim().is_empty() {
286285
continue;
287286
}
288287
match serde_json::from_str::<detector::Finding>(line) {
289288
Ok(mut finding) => {
290-
let normalized = discovery::normalize_crate_name(
291-
&finding.crate_name,
292-
);
289+
let normalized =
290+
discovery::normalize_crate_name(&finding.crate_name);
293291
if let Some((cargo_name, ver)) =
294292
crate_lookup.get(&normalized)
295293
{
@@ -301,9 +299,7 @@ fn run_audit(args: AuditArgs) {
301299
mir_findings.push(finding);
302300
}
303301
Err(e) => {
304-
eprintln!(
305-
"Warning: Failed to parse deep finding: {e}"
306-
);
302+
eprintln!("Warning: Failed to parse deep finding: {e}");
307303
}
308304
}
309305
}
@@ -312,9 +308,7 @@ fn run_audit(args: AuditArgs) {
312308
}
313309
Some(output) => {
314310
let stderr = String::from_utf8_lossy(&output.stderr);
315-
eprintln!(
316-
"Warning: Deep analysis failed (cargo check returned non-zero)."
317-
);
311+
eprintln!("Warning: Deep analysis failed (cargo check returned non-zero).");
318312
for line in stderr
319313
.lines()
320314
.filter(|l| l.contains("error") || l.contains("Error"))

crates/cargo-capsec/tests/integration.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -611,12 +611,7 @@ fn mir_findings_feed_into_cross_crate_propagation() {
611611
};
612612

613613
// Step 2: Build export map from the MIR finding (same as main.rs does)
614-
let mir_export_map = build_export_map(
615-
"ffi_dep",
616-
"1.0.0",
617-
&[mir_finding],
618-
Path::new("src"),
619-
);
614+
let mir_export_map = build_export_map("ffi_dep", "1.0.0", &[mir_finding], Path::new("src"));
620615
assert!(
621616
!mir_export_map.exports.is_empty(),
622617
"MIR finding should produce an export map entry"

0 commit comments

Comments
 (0)