Skip to content

Commit 12612d3

Browse files
Copilot0xrinegade
andcommitted
Implement audit output improvements: --no-commit option, enhanced descriptions, precise code locations, and version bump
Co-authored-by: 0xrinegade <[email protected]>
1 parent a694947 commit 12612d3

File tree

8 files changed

+117
-891
lines changed

8 files changed

+117
-891
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "osvm"
3-
version = "0.4.4"
3+
version = "0.4.5"
44
edition = "2021"
55
license = "MIT"
66
description = "OpenSVM CLI tool for managing SVM nodes and deployments"

src/clparse.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,12 @@ Examples:
869869
870870
If not specified, built-in templates embedded in the binary will be used.")
871871
)
872+
.arg(
873+
Arg::new("no-commit")
874+
.long("no-commit")
875+
.action(ArgAction::SetTrue)
876+
.help("Don't commit audit results to repository. If no output directory is provided, files will be copied to the current folder.")
877+
)
872878
)
873879
.subcommand(
874880
Command::new("new_feature_command")

src/main.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,16 @@ async fn handle_audit_command(
128128
) -> Result<(), Box<dyn std::error::Error>> {
129129
use crate::services::audit_service::{AuditRequest, AuditService};
130130

131-
let output_dir = matches.get_one::<String>("output").unwrap().to_string();
131+
let no_commit = matches.get_flag("no-commit");
132+
let default_output_dir = matches.get_one::<String>("output").unwrap().to_string();
133+
134+
// If --no-commit is used and output directory is the default, use current directory
135+
let output_dir = if no_commit && default_output_dir == "audit_reports" {
136+
".".to_string()
137+
} else {
138+
default_output_dir
139+
};
140+
132141
let format = matches.get_one::<String>("format").unwrap().to_string();
133142
let verbose = matches.get_count("verbose");
134143
let test_mode = matches.get_flag("test");
@@ -144,6 +153,7 @@ async fn handle_audit_command(
144153
ai_analysis,
145154
gh_repo,
146155
template_path,
156+
no_commit,
147157
};
148158

149159
// Create the audit service with or without AI

src/services/audit_service.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ pub struct AuditRequest {
3535
pub ai_analysis: bool,
3636
pub gh_repo: Option<String>,
3737
pub template_path: Option<String>,
38+
pub no_commit: bool,
3839
}
3940

4041
pub struct AuditResult {
@@ -167,6 +168,13 @@ impl AuditService {
167168
if request.ai_analysis {
168169
println!("🤖 AI analysis: enabled");
169170
}
171+
if request.no_commit {
172+
if request.output_dir == "." {
173+
println!("📂 No-commit mode: files will be saved to current directory");
174+
} else {
175+
println!("📂 No-commit mode: files will be saved but not committed to repository");
176+
}
177+
}
170178
if let Some(repo) = &request.gh_repo {
171179
println!("🐙 GitHub repository: {}", repo);
172180
}
@@ -180,7 +188,7 @@ impl AuditService {
180188
}
181189

182190
self.coordinator
183-
.audit_github_repository(repo_spec)
191+
.audit_github_repository(repo_spec, request.no_commit)
184192
.await
185193
.map_err(|e| {
186194
AuditError::AuditExecutionError(format!("GitHub audit failed: {}", e))

src/utils/audit.rs

Lines changed: 89 additions & 75 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)