Skip to main content

SourceFile.feature

SourceFile.feature: list[str]
The package-level features enabled for this package. Only present if the SourceFile represents a BUILD file.

SourceFile.license

SourceFile.license: None | license
License attribute for the file.

SourceFile.location

SourceFile.location: None | str
The location of the source file. This is a path with a line number and a column number not a label in the build system.

SourceFile.name

SourceFile.name: str
The name of the source file (a label).

SourceFile.package_contains_errors

SourceFile.package_contains_errors: None | bool
True if the package contains an error. Only present if the SourceFile represents a BUILD file.

SourceFile.package_group

SourceFile.package_group: list[str]
Labels of package groups that are mentioned in the visibility declaration for this source file.

SourceFile.subinclude

SourceFile.subinclude: list[str]
Labels of .bzl (Starlark) files that are transitively loaded in this BUILD file. This is present only when the SourceFile represents a BUILD file that loaded .bzl files. TODO(bazel-team): Rename this field.

SourceFile.visibility_label

SourceFile.visibility_label: list[str]
Labels mentioned in the visibility declaration (including :pkg and //visibility: ones)