Skip to main content
Version: 0.18.x

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 to generate
report = 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

report

Required.

output file to generate

use_exit_code

Optional. Default: False

whether the protoc process exiting non-zero will be a build failure

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