Skip to content

Conversation

@Ibrahimrahhal
Copy link
Contributor

No description provided.

@asadeddin asadeddin requested a review from Copilot December 24, 2025 12:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for exporting scan reports in Markdown format. The implementation extends the existing export functionality to include Markdown alongside JSON, HTML, and SARIF formats.

Key Changes:

  • Added Markdown as a valid output format option
  • Implemented Markdown export logic in the blast scanner
  • Updated validation to accept "markdown" as a valid format

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/scanners/blast.rs Implements the Markdown export functionality by fetching and writing the report
src/main.rs Updates command-line help text and format validation to include Markdown

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +295 to +308
else if out_format == "markdown" {
let report = match utils::api::get_scan_report(&config.get_url(), &config.get_token(), &scan_id, Some("markdown")) {
Ok(markdown) => markdown,
Err(e) => {
eprintln!("\n\nFailed to fetch Markdown report: {}\n\n", e);
std::process::exit(1);
}
};
*stop_signal.lock().unwrap() = true;
let _ = results_thread.join();
fs::write(out_file.clone(), report).expect("\n\nFailed to write Markdown file, check if the file path is valid and you have the necessary permissions to write to it.");
utils::terminal::clear_previous_line();
println!("\n\nScan report written to: {}\n\n", out_file.clone());
}
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code block duplicates logic from the existing format export blocks. The pattern of fetching the report, stopping the signal, joining the thread, writing the file, and printing the success message is repeated. Consider extracting this common logic into a helper function that takes the format type as a parameter to reduce duplication and improve maintainability.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants