Skip to content

Commit

Permalink
Log clang-format exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
tuokri committed Sep 4, 2024
1 parent 68a5c17 commit 82d4dd4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,9 @@ void clang_format(const std::vector<fs::path>& paths)
const auto path_canonical = fs::canonical(path);
const auto& pstr = path_canonical.string();
std::cout << std::format("running clang-format on '{}'\n", pstr);
bp::execute(bp::process(ctx, cf_prog, {pstr, style_arg, "-i", "--Werror"}));
const auto exit_code = bp::execute(
bp::process(ctx, cf_prog, {pstr, style_arg, "-i", "--Werror"}));
std::cout << std::format("clang-format exited with code: {}\n", exit_code);
// TODO: check exit code and throw on clang_format failure?
}
ctx.run();
Expand Down

0 comments on commit 82d4dd4

Please sign in to comment.