8000 Fix SAM templates treated as normal by api (#2646) · aws-cloudformation/cfn-lint@b9e58bc · GitHub
[go: up one dir, main page]

Skip to content

Commit b9e58bc

Browse files
Fix SAM templates treated as normal by api (#2646)
Fix SAM templates treated as normal with api by calling .transform on the runner.
1 parent c0d09dd commit b9e58bc

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/cfnlint/api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def lint(s: str, rules: RulesCollection, regions: List[str]) -> Matches:
4747
verbosity=0,
4848
mandatory_rules=None,
4949
)
50+
runner.transform()
5051
return runner.run()
5152

5253

test/unit/module/test_api.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,8 @@ def test_issues_template(self):
6666
filename = "test/fixtures/templates/bad/issues.yaml"
6767
matches = self.helper_lint_string_from_file(filename)
6868
self.assertEqual(["E1012"], [match.rule.id for match in matches])
69+
70+
def test_sam_template(self):
71+
filename = "test/fixtures/templates/good/transform/list_transform_many.yaml"
72+
matches = self.helper_lint_string_from_file(filename)
73+
self.assertEqual([], matches)

0 commit comments

Comments
 (0)
0