Skip to content

Commit d634a70

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 d634a70

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
@@ -583,7 +583,7 @@ def _lint_promise_guard(
583583
"""Check that a promise type guard (e.g. `vars:`) for deprecation or unknown type."""
584584
assert _text(node) and len(_text(node)) > 1 and _text(node)[-1] == ":"
585585
promise_type = _text(node)[0:-1]
586-
if promise_type in syntax_data.DEPRECATED_PROMISE_TYPES:
586+
if state.strict and promise_type in syntax_data.DEPRECATED_PROMISE_TYPES:
587587
raise ValidationError(
588588
f"Deprecation: Promise type '{promise_type}' is deprecated {location}",
589589
node,
@@ -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
)

0 commit comments

Comments
 (0)