The rules and macros described below are used to format, test and copy Starlark source files.
On this page:
bzlformat_format(name, output_suffix, srcs)
Formats Starlark source files using Buildifier.
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
output_suffix | The suffix added to the formatted output filename. | String | optional | ".formatted" |
srcs | The Starlark source files to format. | List of labels | required |
bzlformat_missing_pkgs(name, exclude)
Defines executable targets that find, test and fix any Bazel packages that are missing bzlformat_pkg
declarations.
Assuming that the name attribute is bzlformat_missing_pkgs
, the
following targets are defined:
bzlformat_missing_pkgs_find: Find and report any Bazel packages that
are missing the `bzlformat_pkg`
declaration.
bzlformat_missing_pkgs_test: Like the find target except it fails if
any missing packages are found. This is
useful to run in CI test runs to ensure
that all is well.
bzlformat_missing_pkgs_fix: Adds `bzlformat_pkg` declarations to any
Bazel packages that are missing the
declaration.
PARAMETERS
RETURNS
None.
bzlformat_pkg(name, srcs, format_visibility, update_visibility)
Defines targets that format, test, and update the specified Starlark source files.
NOTE: Any labels detected in the srcs
will be ignored.
PARAMETERS
RETURNS
None.