Skip to content

Add buf format to Makefile format target #348

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

Merged
merged 2 commits into from
Aug 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ jobs:
run: make format
- name: Check generated
run: make checkgenerate
env:
BUF_TOKEN: ${{ secrets.BUF_TOKEN }}
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ generate: $(BIN)/buf $(BIN)/license-header ## Regenerate code and license header
.PHONY: format
format: install $(BIN)/license-header ## Format code
$(ADD_LICENSE_HEADER)
buf format --write .
uv run -- ruff format protovalidate test
uv run -- ruff check --fix protovalidate test

Expand Down
16 changes: 13 additions & 3 deletions proto/tests/example/v1/validations.proto
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ message ProtovalidateOneof {
string b = 2;
bool unrelated = 3;
option (buf.validate.message).oneof = {
fields: ["a", "b"]
fields: [
"a",
"b"
]
};
}

Expand All @@ -61,7 +64,10 @@ message ProtovalidateOneofRequired {
string b = 2;
bool unrelated = 3;
option (buf.validate.message).oneof = {
fields: ["a", "b"]
fields: [
"a",
"b"
]
required: true
};
}
Expand All @@ -71,7 +77,11 @@ message ProtovalidateOneofUnknownFieldName {
string b = 2;
bool unrelated = 3;
option (buf.validate.message).oneof = {
fields: ["a", "b", "xxx"]
fields: [
"a",
"b",
"xxx"
]
};
}

Expand Down