-
Notifications
You must be signed in to change notification settings - Fork 590
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into create-pull-request/maintenance-v1
- Loading branch information
Showing
4 changed files
with
45 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
""" | ||
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
SPDX-License-Identifier: MIT-0 | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
import pathlib | ||
|
||
from cfnlint.helpers import load_plugins | ||
|
||
|
||
def test_cfn_lint_rules_have_validate_function(): | ||
root_dir = pathlib.Path(__file__).parent.parent.parent.parent / "src/cfnlint/rules" | ||
rules = load_plugins( | ||
str(root_dir), | ||
"CfnLintKeyword", | ||
"cfnlint.rules.jsonschema.CfnLintKeyword", | ||
) | ||
rules.extend( | ||
load_plugins( | ||
str(root_dir), | ||
"CfnLintJsonSchema", | ||
"cfnlint.rules.jsonschema.CfnLintJsonSchema", | ||
) | ||
) | ||
rules.extend( | ||
load_plugins( | ||
str(root_dir), | ||
"CfnLintJsonSchemaRegional", | ||
"cfnlint.rules.jsonschema.CfnLintJsonSchemaRegional", | ||
) | ||
) | ||
|
||
for rule in rules: | ||
assert hasattr(rule, "validate") | ||
assert callable(rule.validate) | ||
assert "E1101" in rule._parent_rules |
This file contains 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