-
Notifications
You must be signed in to change notification settings - Fork 265
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
Expand buf lint PROTOVALIDATE rule to lint example and shared rules #3317
base: main
Are you sure you want to change the base?
Conversation
private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverhandle/lint.go
Outdated
Show resolved
Hide resolved
private/bufpkg/bufcheck/bufcheckserver/internal/buflintvalidate/field.go
Outdated
Show resolved
Hide resolved
The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).
|
func celTypeForStandardRuleMessageDescriptor( | ||
ruleMessageDescriptor protoreflect.MessageDescriptor, | ||
) *cel.Type { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rodaine Just wondering if there is a better way to do this and/or if protovalidate-go
exposes some mechanism for me to resolve the "type of rule" based on the rule message descriptor (e.g. StringRules
). The context of this is that, we are parsing predefined rules from our files, and then checking their CEL expressions. And so we need the type for the extension itself (which is easy, we use the celext
function you and @oliversun9 exported a while ago) and we also need the type for the rule that the extension is extending.
WIP: Address
TODO
s and add testsThis updates the PROTOVALIDATE rule in buf lint to provide checks for two new features:
buf.validate.*Rules
compiles)The
protovalidate
test dependency has also been updated and some previous integration tests have also been updated to reflect this.