diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-10-05 10:19:53 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-10-05 10:19:53 +0300 |
commit | c9c6e13d1d341f1dc3aa092e1a22aafa0cee14ba (patch) | |
tree | 45563d72eb2cf6871626b191012cf0ac3f10c179 /tools | |
parent | 497699f17d36d0c4a0f9ddfc9f53cf5ccfc085eb (diff) |
global: Reformat sources with gofumpt v0.4.0
Reformat surces with the newly upgraded gofumpt v0.4.0.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/protoc-gen-gitaly-lint/lint.go | 6 | ||||
-rw-r--r-- | tools/protoc-gen-gitaly-lint/main.go | 18 | ||||
-rw-r--r-- | tools/protoc-gen-gitaly-lint/method.go | 4 | ||||
-rw-r--r-- | tools/protoc-gen-gitaly-protolist/main.go | 2 |
4 files changed, 15 insertions, 15 deletions
diff --git a/tools/protoc-gen-gitaly-lint/lint.go b/tools/protoc-gen-gitaly-lint/lint.go index 8bb4c9e70..28dcd54ad 100644 --- a/tools/protoc-gen-gitaly-lint/lint.go +++ b/tools/protoc-gen-gitaly-lint/lint.go @@ -14,9 +14,9 @@ import ( // ensureMethodOpType will ensure that method includes the op_type option. // See proto example below: // -// rpc ExampleMethod(ExampleMethodRequest) returns (ExampleMethodResponse) { -// option (op_type).op = ACCESSOR; -// } +// rpc ExampleMethod(ExampleMethodRequest) returns (ExampleMethodResponse) { +// option (op_type).op = ACCESSOR; +// } func ensureMethodOpType(fileDesc *descriptorpb.FileDescriptorProto, m *descriptorpb.MethodDescriptorProto, req *pluginpb.CodeGeneratorRequest) error { opMsg, err := protoutil.GetOpExtension(m) if err != nil { diff --git a/tools/protoc-gen-gitaly-lint/main.go b/tools/protoc-gen-gitaly-lint/main.go index be7de808b..9a1a610c8 100644 --- a/tools/protoc-gen-gitaly-lint/main.go +++ b/tools/protoc-gen-gitaly-lint/main.go @@ -1,49 +1,49 @@ // Command protoc-gen-gitaly-lint is designed to be used as a protobuf compiler // plugin to verify Gitaly processes are being followed when writing RPC's. // -// Usage +// # Usage // // The protoc-gen-gitaly linter can be chained into any protoc workflow that // requires verification that Gitaly RPC guidelines are followed. Typically // this can be done by adding the following argument to an existing protoc // command: // -// --gitaly_lint_out=. +// --gitaly_lint_out=. // // For example, you may add the linter as an argument to the command responsible // for generating Go code: // -// protoc --go_out=. --gitaly_lint_out=. *.proto +// protoc --go_out=. --gitaly_lint_out=. *.proto // // Or, you can run the Gitaly linter by itself. To try out, run the following // command while in the project root: // -// protoc --gitaly_lint_out=. ./go/internal/cmd/protoc-gen-gitaly-lint/testdata/incomplete.proto +// protoc --gitaly_lint_out=. ./go/internal/cmd/protoc-gen-gitaly-lint/testdata/incomplete.proto // // You should see some errors printed to screen for improperly written // RPC's in the incomplete.proto file. // -// Prerequisites +// # Prerequisites // // The protobuf compiler (protoc) can be obtained from the GitHub page: // https://github.com/protocolbuffers/protobuf/releases // -// Background +// # Background // // The protobuf compiler accepts plugins to analyze protobuf files and generate // language specific code. // // These plugins require the following executable naming convention: // -// protoc-gen-$NAME +// protoc-gen-$NAME // // Where $NAME is the plugin name of the compiler desired. The protobuf compiler // will search the PATH until an executable with that name is found for a // desired plugin. For example, the following protoc command: // -// protoc --gitaly_lint_out=. *.proto +// protoc --gitaly_lint_out=. *.proto // -// The above will search the PATH for an executable named protoc-gen-gitaly-lint +// # The above will search the PATH for an executable named protoc-gen-gitaly-lint // // The plugin accepts a protobuf message in STDIN that describes the parsed // protobuf files. A response is sent back on STDOUT that contains any errors. diff --git a/tools/protoc-gen-gitaly-lint/method.go b/tools/protoc-gen-gitaly-lint/method.go index 39329b521..5d2c00741 100644 --- a/tools/protoc-gen-gitaly-lint/method.go +++ b/tools/protoc-gen-gitaly-lint/method.go @@ -32,8 +32,8 @@ func (ml methodLinter) validateAccessor() error { } // validateMutator will ensure the following rules: -// - Mutator RPC's with repository level scope must specify a target repo -// - Mutator RPC's without target repo must not be scoped at repo level +// - Mutator RPC's with repository level scope must specify a target repo +// - Mutator RPC's without target repo must not be scoped at repo level func (ml methodLinter) validateMutator() error { switch scope := ml.opMsg.GetScopeLevel(); scope { diff --git a/tools/protoc-gen-gitaly-protolist/main.go b/tools/protoc-gen-gitaly-protolist/main.go index 7e775360e..c05facdae 100644 --- a/tools/protoc-gen-gitaly-protolist/main.go +++ b/tools/protoc-gen-gitaly-protolist/main.go @@ -3,7 +3,7 @@ // // This plugin can be accessed by invoking the protoc compiler with the following arguments: // -// protoc --plugin=protoc-gen-gitaly-protolist --gitaly_protolist_out=. +// protoc --plugin=protoc-gen-gitaly-protolist --gitaly_protolist_out=. // // The plugin accepts a protobuf message in STDIN that describes the parsed protobuf files. A // response is sent back on STDOUT that contains any errors. |