Skip to content

Commit

Permalink
more attempts at logging for the CI formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
riesentoaster committed Nov 10, 2024
1 parent ba8a7d5 commit 80856a1
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions utils/libafl_fmt/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,29 +256,33 @@ async fn main() -> io::Result<()> {
let reference_clang_format = format!("clang-format-{REF_LLVM_VERSION}");
let unspecified_clang_format = "clang-format";

let (clang, warning) = if which(&reference_clang_format).is_ok() {
println!(
"Using the reference clang-format with version: {}",
get_version_string(&reference_clang_format, &[]).await?
);

(Some(reference_clang_format.as_str()), None)
let (clang, version, warning) = if which(&reference_clang_format).is_ok() {
(
Some(reference_clang_format.as_str()),
Some(get_version_string(&reference_clang_format, &[]).await?),
None,
)
} else if which(unspecified_clang_format).is_ok() {
let version = get_version_string(unspecified_clang_format, &[]).await?;
(
Some(unspecified_clang_format),
Some(version.clone()),
Some(format!(
"using {}, could provide a different result from {}",
get_version_string(unspecified_clang_format, &[]).await?,
reference_clang_format
"using {version}, could provide a different result from {reference_clang_format}"
)),
)
} else {
(
None,
None,
Some("clang-format not found. Skipping C formatting...".to_string()),
)
};

if let Some(version) = &version {
println!("Using {version}");
}

let mut tokio_joinset = JoinSet::new();

for project in rust_projects_to_fmt {
Expand Down

0 comments on commit 80856a1

Please sign in to comment.