Skip to content

Commit 42899fd

Browse files
committed
cfengine lint: Moved ifvarclass and bundle name lowercase into strict mode
We're not ready yet. Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
1 parent 2d43ee6 commit 42899fd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/cfengine_cli/lint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ 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 state.strict and node.type == "bundle_block_name" and _text(node) != _text(node).lower():
618618
raise ValidationError(
619619
f"Convention: Bundle name should be lowercase {location}", node
620620
)
@@ -763,7 +763,7 @@ def _lint_attribute_name(
763763
"""Check an attribute name for deprecations and validity according to the
764764
surrounding promise type."""
765765
assert node.type == "attribute_name"
766-
if _text(node) == "ifvarclass":
766+
if state.strict and _text(node) == "ifvarclass":
767767
raise ValidationError(
768768
f"Deprecation: Use 'if' instead of 'ifvarclass' {location}", node
769769
)

0 commit comments

Comments
 (0)