@@ -492,6 +492,15 @@ def _lint_node(node: Node, policy_file: PolicyFile, state: State) -> int:
492492 f"Error: Bundle type must be one of ({ ', ' .join (ALLOWED_BUNDLE_TYPES )} ), not '{ _text (node )} ' { location } "
493493 )
494494 return 1
495+ if state .strict and (
496+ node .type in ("bundle_block_name" , "body_block_name" )
497+ and _text (node ) in BUILTIN_FUNCTIONS
498+ ):
499+ _highlight_range (node , lines )
500+ print (
501+ f"Error: { "Bundle" if "bundle" in node .type else "Body" } '{ _text (node )} ' conflicts with built-in function with the same name { location } "
502+ )
503+ return 1
495504 if node .type == "calling_identifier" :
496505 name = _text (node )
497506 qualified_name = _qualify (name , state .namespace )
@@ -515,6 +524,26 @@ def _lint_node(node: Node, policy_file: PolicyFile, state: State) -> int:
515524 f"Error: Call to unknown function / bundle / body '{ name } ' { location } "
516525 )
517526 return 1
527+ if (
528+ name not in BUILTIN_FUNCTIONS
529+ and state .promise_type == "vars"
530+ and state .attribute_name not in ("action" , "classes" )
531+ ):
532+ _highlight_range (node , lines )
533+ print (
534+ f"Error: Call to unknown function '{ name } ' inside 'vars'-promise { location } "
535+ )
536+ return 1
537+ if (
538+ state .promise_type == "vars"
539+ and state .attribute_name in ("action" , "classes" )
540+ and qualified_name not in state .bodies
541+ ):
542+ _highlight_range (node , lines )
543+ print (
544+ f"Error: '{ name } ' is not a defined body. Only bodies may be called with '{ state .attribute_name } ' { location } "
545+ )
546+ return 1
518547 return 0
519548
520549
0 commit comments