Skip to content

Commit 67e6bc2

Browse files
benbridtskddejong
andauthored
Only include json files as registry schemas (#3150)
* Only include json files as registry schemas --------- Co-authored-by: Kevin DeJong <kddejong@amazon.com>
1 parent 1201614 commit 67e6bc2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/cfnlint/core.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ def run_cli(
7373
for path in registry_schemas:
7474
if path and os.path.isdir(os.path.expanduser(path)):
7575
for f in os.listdir(path):
76-
with open(os.path.join(path, f), encoding="utf-8") as schema:
76+
if not f.endswith(".json"):
77+
continue
78+
filename = os.path.join(path, f)
79+
if not os.path.isfile(filename):
80+
continue
81+
with open(filename, encoding="utf-8") as schema:
7782
REGISTRY_SCHEMAS.append(json.load(schema))
7883

7984
return run_checks(filename, template, rules, regions, mandatory_rules)

0 commit comments

Comments
 (0)