Skip to content

False Positive fixes#51

Merged
satyakigh merged 23 commits into
mainfrom
fp-fixes
Jun 26, 2026
Merged

False Positive fixes#51
satyakigh merged 23 commits into
mainfrom
fp-fixes

Conversation

@satyakigh

Copy link
Copy Markdown
Collaborator

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

satyakigh added 21 commits June 25, 2026 18:52
…3505/E3049/E3054/E3048/W2533) + remove I3037
…schemas, update stale tests for corrected behavior
…int: 0 on corpus, fire on genuine cases); scrub cfn-lint refs from code comments; add I2003 lookahead handling
…1028 paths; regen collision fixtures from current cfn-lint; FP 18->14
…ing collapse

F3003 (required-property): skip the generic empty-object required-property
check when the property is structurally an Fn::If. The branch-aware rule
already emits the diagnostic at the branch-qualified path
(<prop>.Fn::If.<idx>); the generic check duplicated it at the un-qualified
property path.

I3042 (hardcoded-partition ARN): collapse hardcoded-partition ARN findings
that are list siblings of one property to the lowest index. List-sibling
Fn::Sub ARNs share a single source location, so they are one observable
finding rather than several. Applied at the resolver->model boundary so
both the CEL and Rego engines inherit it identically.

Precision now 100% (FP=0) on both engines with full parity; golden file
and detailed reports regenerated.
The fixture loader scanned only two directory levels, so result fixtures
under good/resources/properties/ (and other deeply-nested dirs) were never
loaded. Templates without a loaded fixture fall into engine_only and are
excluded from the false-positive tally, which masked genuine engine false
positives and produced a misleading FP=0. Recursing with rglob loads 456
fixtures (was 405) and surfaces the true FP=7 across 5 rules.
After the comparison harness was fixed to load all fixture dirs, FP rose
from a masked 0 to a true 7. This resolves them:

- F1020 (×3): cfn-lint's single E1010 GetAtt rule also covers a missing
  target *resource*, which the engine reports as F1020. Added F1020 to the
  E1010 alias group so the engine's correct finding matches (audit table).
- F3014: the exactly-one-of check counted a property whose value is
  AWS::NoValue as present. Exclude null-resolving members from the tally.
- F3037: array-uniqueness treated AWS::NoValue (null) list items as members,
  flagging two NoValue-collapsed Fn::If branches as duplicates. Skip nulls,
  which CloudFormation strips at deploy time.
- F3012: a wrong-typed property wrapping an Fn::If emitted the same
  property-level type error once per branch scenario. Report it once per path.
- W2511: fired for any policy Version != 2012-10-17 (incl. invalid values,
  which are a schema concern). Restrict to the older-but-valid 2008-10-17,
  matching the upgrade-suggestion semantics. CEL + Rego.

True FP=0 on both engines over the full corpus (456 fixtures); precision
100%, parity verified, golden regenerated. Adds 5 regression tests.
Resolve all clippy lints under -D warnings:
- conditions.rs: collapse FindInMap match arm into the outer Node match
- cel intrinsics.rs: fold the nested GetAtt-attribute if into its else-if chain
- cel resources_extra.rs: collapse the Ref/parameter if-let
- cel structure.rs: simplify the logical-ID boolean via De Morgan's

All behavior-preserving; 1283 workspace tests pass. Also includes rustfmt
line-rewrapping applied across previously-touched files.
F0014 is the single structural-validity rule for all boolean condition
functions (Fn::Equals, Fn::And, Fn::Or, Fn::Not) — cfn-lint splits these
across E8003/E8004/E8005/E8006. The old description named only Fn::Equals,
which misrepresented the rule when it fires for And/Or/Not.
@satyakigh satyakigh changed the title Fp fixes False Positive fixes Jun 26, 2026
@satyakigh satyakigh merged commit d3188fd into main Jun 26, 2026
2 checks passed
@satyakigh satyakigh deleted the fp-fixes branch June 26, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant