fleetlint Policy for a fleet of repositories
v0.6
Getting started

lint/strict/cpp

clang-tidy findings fail the build

Implements lint/strict for cpp.

Severitywarning
Tiers1, 2
Stackscpp
Scopeeach
Kindexpr
Sourcelibrary v0.3.1
Selected byfleetlint-recommended@v0.3.1

Requirement

The nearest .clang-tidy sets WarningsAsErrors (for example '*'), so a finding fails the build instead of scrolling past.

Why

clang-tidy reports warnings and exits 0; without WarningsAsErrors its findings never stop a merge.

Applies when

["", "../", "../../", "../../../"].exists(d, file(d + ".clang-tidy"))

Check

[["", "../", "../../", "../../../"].map(d, d + ".clang-tidy").filter(f, file(f))] .exists(l, [yaml(l[0])].exists(y, y != null && "WarningsAsErrors" in y && y.WarningsAsErrors != null
  && string(y.WarningsAsErrors).trim() != "" && !string(y.WarningsAsErrors).trim().matches("^-\\*$")))

Fix

Set WarningsAsErrors: '*' in .clang-tidy.

Agent instruction: Set WarningsAsErrors: ‘*’ in .clang-tidy and fix the findings that now fail instead of narrowing the check list.

See: https://fleetlint.org/baseline/#static-analysis, https://fleetlint.org/stacks/#cc


Generated by fleetlint docs from catalog v0.3.1.