From 01a50171ffe03dce514529f8b07bd92ffe6933fb Mon Sep 17 00:00:00 2001 From: Stefan VanBuren Date: Fri, 8 Aug 2025 15:04:44 -0400 Subject: [PATCH 1/2] Add `buf format` to Makefile `format` target --- Makefile | 1 + proto/tests/example/v1/validations.proto | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 23ea251..4614c83 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/proto/tests/example/v1/validations.proto b/proto/tests/example/v1/validations.proto index fbf0467..e942451 100644 --- a/proto/tests/example/v1/validations.proto +++ b/proto/tests/example/v1/validations.proto @@ -52,7 +52,10 @@ message ProtovalidateOneof { string b = 2; bool unrelated = 3; option (buf.validate.message).oneof = { - fields: ["a", "b"] + fields: [ + "a", + "b" + ] }; } @@ -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 }; } @@ -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" + ] }; } From 31ed4b4477514edd4960f9a0c69af6e639324f01 Mon Sep 17 00:00:00 2001 From: Stefan VanBuren Date: Fri, 8 Aug 2025 15:36:37 -0400 Subject: [PATCH 2/2] Add BUF_TOKEN to `make checkgenerate` step --- .github/workflows/ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6cfb19f..dee41d6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -39,3 +39,5 @@ jobs: run: make format - name: Check generated run: make checkgenerate + env: + BUF_TOKEN: ${{ secrets.BUF_TOKEN }}