Skip to content

Commit 4244af2

Browse files
authored
Remove rule setting in propertyNames rule (#3365)
* Remove rule setting in propertyNames rule * Import requests into maintenance job
1 parent 6f46af4 commit 4244af2

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

.github/workflows/maintenance-v1.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
latest=`curl "https://pypi.org/pypi/aws-sam-cli/$latest_sam_cli/json" -s | jq -r '.info.requires_dist[] | select(contains("aws-sam-translator"))' | cut -c 21-`
2121
sed -i -E "s/aws-sam-translator>=[0-9.]+/aws-sam-translator>=$latest/" pyproject.toml
2222
pip install -e .
23+
pip install requests
2324
rm -rf src/cfnlint/data/DownloadsMetadata/*
2425
cfn-lint --update-iam-policies
2526
cfn-lint --update-documentation

src/cfnlint/rules/jsonschema/PropertyNames.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,8 @@ def propertyNames(
6666
)({})
6767

6868
for property in instance:
69-
for err in v.descend(
69+
yield from v.descend(
7070
instance=property,
7171
schema=propertyNames,
7272
path=property,
73-
):
74-
if err.rule is None:
75-
err.rule = self
76-
yield err
73+
)

test/unit/rules/jsonschema/test_property_names.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def __init__(self):
108108
)
109109

110110
self.assertEqual(len(errs), 1)
111-
self.assertEqual(errs[0].rule.id, "AAAAA")
111+
self.assertIsNone(errs[0].rule)
112112

113113
def test_rule_not_object(self):
114114
validator = CfnTemplateValidator({})

0 commit comments

Comments
 (0)