You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Is there a way to add custom buf plugins to buf_lint_test? #102
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?
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.)
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.
Activity
mkanat commentedon Feb 8, 2026
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.)
srikrsna-buf commentedon Feb 10, 2026
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.