Skip to content

Commit dc3041c

Browse files
committed
fix(cppcheck): adjust linter parameter
1 parent 499476d commit dc3041c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/linters/c/cppcheck/cppcheck.go

+5-1
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 setting being normal
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)