Skip to content

Commit 7cbe7a7

Browse files
authored
Merge pull request #105 from olehermanse/main
cfengine lint: Moved ifvarclass and bundle name lowercase into strict mode
2 parents 2d43ee6 + db43198 commit 7cbe7a7

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/cfengine_cli/lint.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,11 @@ def _lint_block_name(node: Node, state: State, location: str, syntax_data: Synta
614614
"""Check that a block name follows conventions and doesn't shadow a built-in."""
615615
assert node.type in ("bundle_block_name", "body_block_name", "promise_block_name")
616616

617-
if node.type == "bundle_block_name" and _text(node) != _text(node).lower():
617+
if (
618+
state.strict
619+
and node.type == "bundle_block_name"
620+
and _text(node) != _text(node).lower()
621+
):
618622
raise ValidationError(
619623
f"Convention: Bundle name should be lowercase {location}", node
620624
)
@@ -763,7 +767,7 @@ def _lint_attribute_name(
763767
"""Check an attribute name for deprecations and validity according to the
764768
surrounding promise type."""
765769
assert node.type == "attribute_name"
766-
if _text(node) == "ifvarclass":
770+
if state.strict and _text(node) == "ifvarclass":
767771
raise ValidationError(
768772
f"Deprecation: Use 'if' instead of 'ifvarclass' {location}", node
769773
)

0 commit comments

Comments
 (0)