Skip to content

Add support for plugin path overrides in protoc-gen-buf-{lint,breaking} - #3871

Merged
doriable merged 2 commits into
mainfrom
3867-buf-plugin-custom-paths-protoc-gen-buf-lint-breaking
Jun 18, 2025
Merged

doriable merged 2 commits into
mainfrom
3867-buf-plugin-custom-paths-protoc-gen-buf-lint-breaking

Conversation

@doriable

Copy link
Copy Markdown
Member

This PR adds support to protoc-gen-buf-{lint,breaking} for overriding
local plugin paths. protoc-gen-buf-{lint,breaking} do not support running
remote check plugins, only local.

The primary use-case for this is Bazel, which runs protoc-gen-buf-{lint,breaking}
in a sandboxed environment. rules_buf needs to be able to provide
path overrides to local check plugin binaries.

If an override for a plugin config is not provided, if the plugin config is
a remote plugin, we return an error, otherwise we attempt to use the
plugin config as-is.

Fixes #3867

@github-actions

github-actions Bot commented Jun 13, 2025 •

Copy link
Copy Markdown
Contributor

The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJun 16, 2025, 5:54 PM

Comment thread private/buf/cmd/internal/internal.go Outdated
}
}

// GetModuleConfigForProtocPlugin gets ModuleConfigs for the protoc plugin implementations.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this method still used?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, it is not -- I need to remove it, thank you!

@doriable

Copy link
Copy Markdown
Member Author

Tested this against a local Bazel test setup, things look good. Going to merge.

@doriable
doriable merged commit 139f92e into main Jun 18, 2025
@doriable
doriable deleted the 3867-buf-plugin-custom-paths-protoc-gen-buf-lint-breaking branch June 18, 2025 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a way to supply custom buf plugin paths to protoc-gen-buf-*

3 participants