Skip to content

Is there a way to add custom buf plugins to buf_lint_test? #102

Open

Description

@rmm-stripe

Hello! I saw that buf supports custom plugins. I'm curious to find out if there is a way to write a custom plugin so that it can be run as a part of the buf_lint_test bazel rule. As in, I can write the plugin, include it in my config buf.yaml file and have the buf_lint_test run it.

Looking at buf_lint_test's atrributes, I was assuming that there would need to be some sort of way for me to pass a dependency on a binary that holds the logic for my custom plugin, but I don't see that reflected in any of the attributes. Wondering if there is a paved path for this already?

If this doesn't exist, would it be complicated to add?

Activity

  1. mkanat commented on Feb 8, 2026

    @mkanat

    Hey, so that PR was actually merged, so the protoc plugin supports buf plugins now! However, it hasn't been plumbed through to the buf_lint_test rule.

    The work for plugins shouldn't be very complex at all, since a plugin is just a go_binary. I already have my local buf lint using the plugin out of the bazel-bin directory; you just have to change your buf.yaml to point there or pass it in in the config json to the protoc plugin, I suppose. (That would be nice because then buf lint could still use the local bazel-bin path while the build uses the relative sandbox path.)

  2. srikrsna-buf commented on Feb 10, 2026

    @srikrsna-buf
    Contributor

    With bufbuild/buf#3871, we can add support for these. We haven't gotten around to doing it yet. I see that you attempted to add it to rules_lint, using the plugin overrides is key, as that allows us to pass the sandbox path to the plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions