Files
floci/tools/partition
Hector Ventura ae216f22a0 chore(core): gate comparisons of a partition with the literal "aws" (#4892)
* chore(core): gate comparisons of a partition with the literal "aws"

The five checks #4791 fixed compared a parsed ARN's partition with "aws", so
RDS, ElastiCache and RAM broke silently outside the commercial partition, and
make partition-check could not see them: a bare "aws" is not an arn:aws:
prefix. partition_literals.py gains a gated aws-partition-compare category,
scanned over the code with comments and text blocks blanked, that catches
"aws".equals(...), .equals("aws"), their equalsIgnoreCase forms and
Objects.equals with "aws". Run against main before #4791 it reports exactly
those five sites.

The three remaining uses compare an account, a command name and a reserved
SSM name prefix, not a partition, and are escaped with a reason. AGENTS.md
states the rule next to the other partition rules, so reviews flag it too.
The audit table sizes its columns to the longest category name.

Part of #4272.

* chore(core): end the Objects.equals match at its call and gate switch labels on "aws"

Greptile on #4892: the Objects.equals arm read past the call's closing
parenthesis, so foo(Objects.equals(a, b), "aws") matched a comparison that is
not there; each argument now allows one level of nested calls and the match
ends at the call's own parenthesis. And a switch on a partition branched on
"aws" without a match, so case labels naming "aws", alone or in a list, are
caught too. main has none, so no new escapes and the baseline stays empty.
2026-10-02 09:36:30 -04:00
..