Skip to content

Commit

Permalink
Only include json files as registry schemas (#3150)
Browse files Browse the repository at this point in the history
* Only include json files as registry schemas

---------

Co-authored-by: Kevin DeJong <[email protected]>
  • Loading branch information
benbridts and kddejong authored Apr 18, 2024
1 parent 1201614 commit 67e6bc2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/cfnlint/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ def run_cli(
for path in registry_schemas:
if path and os.path.isdir(os.path.expanduser(path)):
for f in os.listdir(path):
with open(os.path.join(path, f), encoding="utf-8") as schema:
if not f.endswith(".json"):
continue
filename = os.path.join(path, f)
if not os.path.isfile(filename):
continue
with open(filename, encoding="utf-8") as schema:
REGISTRY_SCHEMAS.append(json.load(schema))

return run_checks(filename, template, rules, regions, mandatory_rules)
Expand Down

0 comments on commit 67e6bc2

Please sign in to comment.