Skip to content

Commit 3713a50

Browse files
authored
fix(cppcheck): adjust linter parameter (#524)
1 parent c58ab93 commit 3713a50

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/linters/c/cppcheck/cppcheck.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ func init() {
3636
func cppcheckHandler(ctx context.Context, a lint.Agent) error {
3737
log := util.FromContext(ctx)
3838
if lint.IsEmpty(a.LinterConfig.Args...) {
39-
a.LinterConfig.Args = append([]string{}, "--quiet", "--template='{file}:{line}:{column}: {message}'", ".")
39+
// The check-level parameter has been supported since version 2.11, with the default normal mode.
40+
// In exhaustive mode, Cppcheck performs additional inspection rules and more complex analysis, potentially uncovering issues that may not be detected in the default normal mode.
41+
// However, this mode comes at the cost of longer execution times, making it suitable for scenarios where higher code quality is desired and longer waiting times are acceptable.
42+
// From version 2.14, the linter will prompt: "Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches."
43+
a.LinterConfig.Args = append([]string{}, "--quiet", "--check-level=exhaustive", "--template='{file}:{line}:{column}: {message}'", ".")
4044
}
4145

4246
return lint.GeneralHandler(ctx, log, a, lint.ExecRun, parser)

0 commit comments

Comments
 (0)