buf
API for calling declaring a buf lint aspect.
Typical usage:
load("@aspect_rules_lint//lint:buf.bzl", "buf_lint_aspect")
buf = buf_lint_aspect(
config = "@@//path/to:buf.yaml",
)
Macros and Functions
buf_lint_action
Runs the buf lint tool as a Bazel action.
Example usage (generated):
load("@aspect_rules_lint//lint:buf.bzl", "buf_lint_action")
buf_lint_action(
# Rule OR Aspect context
ctx = None,
# the buf-lint executable
buf = None,
# the protoc executable
protoc = None,
# the proto_library target to run on
target = None,
# output file containing the stderr of protoc
stderr = None,
)
ctx
Required.
Rule OR Aspect context
buf
Required.
the buf-lint executable
protoc
Required.
the protoc executable
target
Required.
the proto_library target to run on
stderr
Required.
output file containing the stderr of protoc
exit_code
Optional. Default: None
output file to write the exit code. If None, then fail the build when protoc exits non-zero.
lint_buf_aspect
A factory function to create a linter aspect.
Example usage (generated):
load("@aspect_rules_lint//lint:buf.bzl", "lint_buf_aspect")
lint_buf_aspect(
# label of the the buf.yaml file
config = None,
)
config
Required.
label of the the buf.yaml file
toolchain
Optional. Default: "@rules_buf//tools/protoc-gen-buf-lint:toolchain_type"
override the default toolchain of the protoc-gen-buf-lint tool
rule_kinds
Optional. Default: ["proto_library"]
which kinds of rules should be visited by the aspect