Aggregate warning flags into a compact status count.

Aggregate Flags

aggregate_flags.lua
local allowed = 
local warnings = 0

for _, flag in ipairs({false, true, true}) do
  if flag then
    warnings = warnings + 1
  end
end

local status = "pass"
if warnings > allowed then
  status = "review"
end

print("allowed=" .. allowed)
print("warnings=" .. warnings)
print("status=" .. status)
local allowed = 
local warnings = 0

for _, flag in ipairs({false, true, true}) do
  if flag then
    warnings = warnings + 1
  end
end

local status = "pass"
if warnings > allowed then
  status = "review"
end

print("allowed=" .. allowed)
print("warnings=" .. warnings)
print("status=" .. status)
local allowed = 
local warnings = 0

for _, flag in ipairs({false, true, true}) do
  if flag then
    warnings = warnings + 1
  end
end

local status = "pass"
if warnings > allowed then
  status = "review"
end

print("allowed=" .. allowed)
print("warnings=" .. warnings)
print("status=" .. status)
flag aggregation Small pipelines often turn several booleans into one count and one decision.
guard The allowed warning count controls whether the summary is accepted.