unconfigured_target_node
type
Methods for unconfigured target node.
unconfigured_target_node.attrs
unconfigured_target_node.attrs: typing.Any
Gets the coerced attributes from the unconfigured target node. Returns a struct.
Sample usage:
def _impl_attributes(ctx):
target_node = ctx.uquery().eval("owner('path/to/file')")[0]
ctx.output.print(target_node.attrs.my_attr)
unconfigured_target_node.buildfile_path
unconfigured_target_node.buildfile_path: file_node
Gets the buildfile path from the unconfigured target node.
Sample usage:
def _impl_label(ctx):
target_node = ctx.uquery().eval("owner('path/to/file')")[0]
ctx.output.print(target_node.buildfile_path)
unconfigured_target_node.label
unconfigured_target_node.label: target_label
Gets the label from the unconfigured target node.
Sample usage:
def _impl_label(ctx):
target_node = ctx.uquery().eval("owner('path/to/file')")[0]
ctx.output.print(target_node.label)
unconfigured_target_node.rule_type
unconfigured_target_node.rule_type: str
Gets the fully qualified name of the rule for this unconfigured target node as a string. This includes the import path as well.
Sample usage:
def _impl_rule_type(ctx):
target_node = ctx.uquery().owner('path/to/file')[0]
ctx.output.print(target_node.rule_type)