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

[Tooling] Add protocheck status-errors subcmd to check for non-gRPC status error returns #929

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 13 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
7 changes: 7 additions & 0 deletions makefiles/checks.mk
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,10 @@ check_proto_unstable_marshalers: ## Check that all protobuf files have the `stab
fix_proto_unstable_marshalers: ## Ensure the `stable_marshaler_all` option is present on all protobuf files.
go run ./tools/scripts/protocheck/cmd unstable --fix
${MAKE} proto_regen

MODULE ?= "*"
LEVEL ?= "info"

.PHONY: check_grpc_status_errors
check_grpc_status_errors: ## Check that all gRPC service handlers return gRPC status errors.
go run ./tools/scripts/protocheck/cmd status-errors -m ${MODULE} -l ${LEVEL}
8 changes: 8 additions & 0 deletions pkg/polylog/polyzero/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,11 @@ func WithSetupFn(fn func(logger *zerolog.Logger)) polylog.LoggerOption {
fn(&logger.(*zerologLogger).Logger)
}
}

// TODO_IN_THIS_COMMIT: godoc & test...

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[linter-name (fail-on-found)] reported by reviewdog 🐶
// TODO_IN_THIS_COMMIT: godoc & test...

func WithWriter(writer io.Writer) polylog.LoggerOption {
return func(logger polylog.Logger) {
zl := logger.(*zerologLogger).Logger
logger.(*zerologLogger).Logger = zl.Output(writer)
}
}
Loading
Loading