lint per file
gives paralellism
This commit is contained in:
76
build.zig
76
build.zig
@@ -71,44 +71,48 @@ pub fn build(b: *std.Build) !void {
|
|||||||
|
|
||||||
const lint_step = b.step("lint", "Run linters");
|
const lint_step = b.step("lint", "Run linters");
|
||||||
|
|
||||||
const clang_analyze = b.addSystemCommand(&.{
|
for (all_c_files) |cfile| {
|
||||||
"clang",
|
const clang_analyze = b.addSystemCommand(&.{
|
||||||
"--analyze",
|
"clang",
|
||||||
"--analyzer-output",
|
"--analyze",
|
||||||
"text",
|
"--analyzer-output",
|
||||||
"-Wno-unused-command-line-argument",
|
"text",
|
||||||
"-Werror",
|
"-Wno-unused-command-line-argument",
|
||||||
});
|
"-Werror",
|
||||||
for (all_c_files) |cfile| clang_analyze.addFileArg(b.path(cfile));
|
});
|
||||||
clang_analyze.expectExitCode(0);
|
clang_analyze.addFileArg(b.path(cfile));
|
||||||
lint_step.dependOn(&clang_analyze.step);
|
clang_analyze.expectExitCode(0);
|
||||||
|
lint_step.dependOn(&clang_analyze.step);
|
||||||
|
|
||||||
const gcc_analyze = b.addSystemCommand(&.{
|
const gcc_analyze = b.addSystemCommand(&.{
|
||||||
"gcc",
|
"gcc",
|
||||||
"--analyzer",
|
"-c",
|
||||||
"-Werror",
|
"--analyzer",
|
||||||
"-o",
|
"-Werror",
|
||||||
"/dev/null",
|
"-o",
|
||||||
});
|
"/dev/null",
|
||||||
for (all_c_files) |cfile| gcc_analyze.addFileArg(b.path(cfile));
|
});
|
||||||
gcc_analyze.expectExitCode(0);
|
gcc_analyze.addFileArg(b.path(cfile));
|
||||||
lint_step.dependOn(&gcc_analyze.step);
|
gcc_analyze.expectExitCode(0);
|
||||||
|
lint_step.dependOn(&gcc_analyze.step);
|
||||||
|
|
||||||
const cppcheck = b.addSystemCommand(&.{
|
const cppcheck = b.addSystemCommand(&.{
|
||||||
"cppcheck",
|
"cppcheck",
|
||||||
"--quiet",
|
"--quiet",
|
||||||
"--error-exitcode=1",
|
"--error-exitcode=1",
|
||||||
"--check-level=exhaustive",
|
"--check-level=exhaustive",
|
||||||
"--enable=all",
|
"--enable=all",
|
||||||
"--inline-suppr",
|
"--inline-suppr",
|
||||||
"--suppress=missingIncludeSystem",
|
"--suppress=missingIncludeSystem",
|
||||||
"--suppress=checkersReport",
|
"--suppress=checkersReport",
|
||||||
"--suppress=unusedFunction", // TODO remove after plumbing is done
|
"--suppress=unusedFunction", // TODO remove after plumbing is done
|
||||||
"--suppress=unusedStructMember", // TODO remove after plumbing is done
|
"--suppress=unusedStructMember", // TODO remove after plumbing is done
|
||||||
});
|
"--suppress=unmatchedSuppression",
|
||||||
for (all_c_files) |cfile| cppcheck.addFileArg(b.path(cfile));
|
});
|
||||||
cppcheck.expectExitCode(0);
|
cppcheck.addFileArg(b.path(cfile));
|
||||||
lint_step.dependOn(&cppcheck.step);
|
cppcheck.expectExitCode(0);
|
||||||
|
lint_step.dependOn(&cppcheck.step);
|
||||||
|
}
|
||||||
|
|
||||||
const all_step = b.step("all", "Run fmt check, lint, and tests with all compilers");
|
const all_step = b.step("all", "Run fmt check, lint, and tests with all compilers");
|
||||||
all_step.dependOn(lint_step);
|
all_step.dependOn(lint_step);
|
||||||
|
|||||||
Reference in New Issue
Block a user