Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add comment ignores to example #314

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
2 changes: 2 additions & 0 deletions docs/buf.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions example/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ use_repo(
)

buf = use_extension("@rules_buf//buf:extensions.bzl", "buf")
buf.toolchains(version = "v1.31.0")
alexeagle marked this conversation as resolved.
Show resolved Hide resolved
use_repo(buf, "rules_buf_toolchains")

rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
Expand Down
5 changes: 5 additions & 0 deletions example/buf.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
version: v1

lint:
use:
- DEFAULT
allow_comment_ignores: true
SpencerC marked this conversation as resolved.
Show resolved Hide resolved
except:
- IMPORT_USED
- RPC_REQUEST_STANDARD_NAME
3 changes: 3 additions & 0 deletions example/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ args+=(
# See https://github.com/aspect-build/rules_ts/pull/574#issuecomment-2073632879
"--norun_validations"
"--build_event_json_file=$buildevents"
# Required for the buf allow_comment_ignores option to work properly
# See https://github.com/bufbuild/rules_buf/issues/64#issuecomment-2125324929
"--experimental_proto_descriptor_sets_include_source_info"
SpencerC marked this conversation as resolved.
Show resolved Hide resolved
"--output_groups=rules_lint_report"
"--remote_download_regex='.*AspectRulesLint.*'"
)
Expand Down
13 changes: 13 additions & 0 deletions example/src/file.proto
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
syntax = "proto3";

import "src/unused.proto";

message HttpBody {
string name = 1;
}

message Empty {}

service HttpService {
// Receives an inbound message an http client.
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
rpc ReceiveMessage (HttpBody) returns (Empty) {}
}
Loading