Skip to content

Commit 8a227cd

Browse files
committed
cfengine lint: Skipped validating custom promise type attributes
Syntax description does not, and cannot have data about custom promise types. We don't have a (easy) way to validate custom promise types yet. Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
1 parent da77d6e commit 8a227cd

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/cfengine_cli/lint.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,9 @@ def _lint_node(
658658
promise_type_data = syntax_data.BUILTIN_PROMISE_TYPES.get(
659659
state.promise_type, {}
660660
)
661+
if not promise_type_data:
662+
# Custom promise type - we cannot validate attribute name here.
663+
return 0
661664
promise_type_attrs = promise_type_data.get("attributes", {})
662665
if state.attribute_name not in promise_type_attrs:
663666
_highlight_range(node, lines)

0 commit comments

Comments
 (0)