Repository navigation
fix(E1700): stop rejecting rule names CloudFormation accepts - #4924
Merged
kddejong merged 2 commits intoOct 30, 2026
Merged
Conversation
The Rules section schema restricted rule logical IDs to ^[A-Za-z0-9]+$ with additionalProperties false, so names such as Env_Check or Env-Check were reported even though CloudFormation creates the stack. Validate every value against the rule definition instead of restricting the key, as was done for condition names in E8001. Fixes aws-cloudformation#4837 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Dropping patternProperties from the Rules schema also dropped the only place add_cfn_lint_keyword was re-enabled, so nested dispatch stayed off and every intrinsic-function check inside Rules went silent. Register an additionalProperties override alongside the patternProperties one and delegate to the stock keyword, restoring E1020, E1701, E8003 and W8003 inside the Rules section.
kddejong
force-pushed
the
fix/e1700-rule-names
branch
from
October 30, 2026 23:18
396abad to
368d0db
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4924 +/- ##
=======================================
Coverage 94.73% 94.74%
=======================================
Files 442 442
Lines 16102 16105 +3
Branches 3125 3125
=======================================
+ Hits 15255 15258 +3
- Misses 467 468 +1
+ Partials 380 379 -1
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 #4837
Description of changes:
E1700 validated the
Rulessection againstsrc/cfnlint/data/schemas/other/rules/configuration.json, which allowed rule logical names only through the key pattern^[A-Za-z0-9]+$withadditionalProperties: false. A rule namedEnv_CheckorEnv-Checkwas reported asdoes not match any of the regexes, although CloudFormation creates the stack and the rule assertions pass (the issue reportsCREATE_COMPLETEin us-east-1).The key restriction is dropped and every value is validated against the rule definition through
additionalProperties, the same approach used for condition names in #4787. The value checks are unchanged: a rule withoutAssertions, or with a non-object value, still reports an error.Tests:
test/unit/rules/rules/test_configuration.pyhas a new case withEnv_Check,Env-CheckandEnv.Check, and the two existing cases use the new schema path. They fail with the previous schema and pass with the change.cfn-linton the template from the issue no longer reports E1700, andtest/unitpasses apart from tests that need optional dependencies not installed in the test environment.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
This change was prepared with Claude Code (AI-assisted); the tests above were run.
🤖 Generated with Claude Code