Repository navigation
Conversation
hoganbr-amzn
marked this pull request as ready for review
October 30, 2026 19:34
The approaching-limit child of E2011 and E7002 is only reported from the propertyNames handler in the shared PropertyNames rule. E2001 and E7001 mapped maxLength but not propertyNames to these rules, so the handler never ran for Parameters and Mappings. Map propertyNames the same way Outputs and Resources do. Names over 255 characters now report "'<name>' is longer than 255", the message E6011 and E3011 already use. Fixes aws-cloudformation#4960 Signed-off-by: Brenden Hogan <hoganbr@amazon.com>
kddejong
force-pushed
the
fix/i2011-i7002-property-names
branch
from
October 30, 2026 23:01
a0edf6f to
12b9b76
Compare
kddejong
approved these changes
Oct 30, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4965 +/- ##
=======================================
Coverage 94.73% 94.73%
=======================================
Files 442 442
Lines 16102 16102
Branches 3125 3125
=======================================
Hits 15255 15255
Misses 467 467
Partials 380 380
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available: Fixes #4960
Description of changes:
I2011 (Parameter name approaching the limit) and I7002 (Mapping name approaching the limit) never reported. E2011 and E7002 extend
jsonschema.PropertyNames, which reports the approaching-limit child only from_max_length. That helper is installed inside itspropertyNameskeyword handler. E2001 (rules/parameters/Configuration.py) and E7001 (rules/mappings/Configuration.py) mapped onlymaxLengthto E2011 and E7002, so the handler never ran for these sections.This change adds
"propertyNames": "E2011"and"propertyNames": "E7002"to the tworule_setmaps. Outputs ("propertyNames": "E6011") and Resources ("propertyNames": "E3011") are already wired this way, which is why I6011 and I3012 report today. The Mappings entry was dropped in #3257.expected maximum length: 255, found: 256'<name>' is longer than 255expected maximum length: 255, found: 256'<name>' is longer than 255The new over-limit message is the one E6011 and E3011 already use. No snapshot under
test/fixtures/results/or entry indocs/rules.mdreferences the old text.E2001 still reports an unknown Parameter attribute, such as
Foo, because the error keepspropertyNamesandenumin its schema path. A test case pins this.Evidence. The CloudFormation quotas page lists 255 characters for a parameter name and for a mapping name and mapping attribute name. CloudFormation stack in us-east-1, in a personal AWS account, on 2026-10-22: the template in #4960 reached CREATE_COMPLETE with 240-character Parameter, Mapping, Resource and Output names. So names in the I2011 and I7002 range deploy, and the change adds informational findings only.
Tests. The new tests are
test/unit/rules/parameters/test_property_names.pyandtest/unit/rules/mappings/test_max_length.py. They run a fullcfnlint.api.lintrather than the single-rulevalidatorfixture, because the bug is in how E2001 and E7001 wire in their child rules, and the fixture loads no child rules. They assert the rule id and exact message at 229, 230, 255 and 256 characters, for Parameter names, Mapping names and Mapping attribute names. Onmain, 10 of the 17 cases fail.Verification, on this branch and on
main(008ead6), with specs fromcfn-lint --update-specs:cfn-lint --regions us-east-1 -c I -- template.yamlon the I2011, I7002: Parameter and Mapping names approaching the 255-character limit are never reported #4960 template:mainreports I3012 and I6011; this branch also reports I2011 and I7002.python -m pytest test: 3269 passed onmain, 3286 passed on this branch, no failures on either.cfn-lint -c I -f parseable -t "test/fixtures/templates/good/**/*.yaml" "test/fixtures/templates/good/**/*.json": identical output on both apart from log timestamps and paths, with no E2011, I2011, E7002 or I7002 on any good fixture.pre-commit run --all-files: passes.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.