Kaydet (Commit) 5f5f0937 authored tarafından Miklos Vajna's avatar Miklos Vajna

clang-format: improve error message when CI fails

Don't just tell the problem but hint how to fix it.

Change-Id: I9d079ee7d4ed61266e22a3fa21efe10366724645
Reviewed-on: https://gerrit.libreoffice.org/49471Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst 4b938c55
......@@ -204,6 +204,8 @@ sub check_style($)
print("and the clang-format rules. Fixing these now automatically.\n");
print("Running '$clang_format -i " . join(" ", @bad_names) . "' for you...\n");
system("$clang_format -i " . join(" ", @bad_names));
# TODO this stages all local modifications, staging originally
# unstaged hunks.
system("git add " . join(" ", @bad_names));
print("Done.\n");
}
......
......@@ -60,7 +60,10 @@ sub check_style()
if (scalar @bad_names)
{
print("\nERROR: The above differences were found between the code to commit \n");
print("and the clang-format rules.\n");
print("and the clang-format rules. Tips:\n");
print("\n- You may run '/opt/lo/bin/clang-format -i <problematic file>' to fix up style automatically.\n");
print("- See solenv/clang-format/README on where to get the required version of clang-format binaries.\n");
print("- If you renamed a blacklisted file, update solenv/clang-format/blacklist accordingly to keep it blacklisted.\n");
print("\nsolenv/clang-format/check-last-commit: KO\n");
exit(1);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment