Skip to content

Add module option to lint and breaking rules#65

Merged
srikrsna-buf merged 2 commits intomainfrom
sk/v2/config
May 22, 2024
Merged

Add module option to lint and breaking rules#65
srikrsna-buf merged 2 commits intomainfrom
sk/v2/config

Conversation

@srikrsna-buf
Copy link
Copy Markdown
Member

Related to #63. This adds support for the module option introduced in the plugin versions v1.32.1. Users need to specify the module option to specify which module rules to apply for a given target.

With v1, the rule expects the config of the current module:

buf_lint_test(
    name = "bar_proto_lint",
    config = "//barapis:buf.yaml", # Config of the current module located at `barapis` directory
    targets = [":bar_proto"],
)

With v2 we refer to the root buf.yaml and specify the module that the current proto target belongs to:

buf_lint_test(
    name = "bar_proto_lint",
    config = "//:buf.yaml", # The root `buf.yaml`
    module = "barapis", # The path or full module name that this target belongs to
    targets = [":bar_proto"],
)

@srikrsna-buf srikrsna-buf requested a review from emcfarlane May 22, 2024 09:56
@srikrsna-buf srikrsna-buf changed the title Add module option to lint and breaking rules. Add module option to lint and breaking rules May 22, 2024
@srikrsna-buf srikrsna-buf merged commit 6a38b28 into main May 22, 2024
@srikrsna-buf srikrsna-buf deleted the sk/v2/config branch May 22, 2024 11:42
@srikrsna-buf srikrsna-buf mentioned this pull request May 22, 2024
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.

2 participants