Skip to content

Commit

Permalink
Remove support for deprecated protovalidate options
Browse files Browse the repository at this point in the history
  • Loading branch information
jchadwick-buf committed Jan 27, 2025
1 parent 34d54b9 commit b032681
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 37 deletions.
8 changes: 0 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,6 @@ issues:
- gochecknoinits
# we actually want to use this init to create a protovalidate.Validator
path: private/bufpkg/bufcas/proto.go
- linters:
- staticcheck
text: "GetIgnoreEmpty is deprecated"
path: private/bufpkg/bufcheck/bufcheckserver/internal/buflintvalidate/field.go
- linters:
- staticcheck
text: "GetSkipped is deprecated"
path: private/bufpkg/bufcheck/bufcheckserver/internal/buflintvalidate/field.go
- linters:
- gochecknoinits
# we actually want to use init here
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,15 +301,6 @@ func checkFieldFlags(
fieldCount++
return true
})
if fieldConstraints.GetSkipped() && fieldCount > 1 {
adder.addForPathf(
[]int32{skippedFieldNumber},
"Field %q has %s and therefore other rules in %s are not applied and should be removed.",
adder.fieldName(),
adder.getFieldRuleName(skippedFieldNumber),
adder.getFieldRuleName(),
)
}
if fieldConstraints.GetIgnore() == validate.Ignore_IGNORE_ALWAYS && fieldCount > 1 {
adder.addForPathf(
[]int32{ignoreFieldNumber},
Expand All @@ -320,18 +311,6 @@ func checkFieldFlags(
adder.getFieldRuleName(),
)
}
if fieldConstraints.GetRequired() && fieldConstraints.GetIgnoreEmpty() {
adder.addForPathsf(
[][]int32{
{requiredFieldNumber},
{ignoreEmptyFieldNumber},
},
"Field %q has both %s and %s. A field cannot be empty if it is required.",
adder.fieldName(),
adder.getFieldRuleName(requiredFieldNumber),
adder.getFieldRuleName(ignoreEmptyFieldNumber),
)
}
if fieldConstraints.GetRequired() && fieldConstraints.GetIgnore() == validate.Ignore_IGNORE_IF_UNPOPULATED {
adder.addForPathsf(
[][]int32{
Expand Down Expand Up @@ -395,14 +374,6 @@ func checkConstraintsForExtension(
adder.getFieldRuleName(requiredFieldNumber),
)
}
if fieldConstraints.GetIgnoreEmpty() {
adder.addForPathf(
[]int32{ignoreEmptyFieldNumber},
"Field %q is an extension field and cannot have %s.",
adder.fieldName(),
adder.getFieldRuleName(ignoreEmptyFieldNumber),
)
}
if fieldConstraints.GetIgnore() == validate.Ignore_IGNORE_IF_UNPOPULATED {
adder.addForPathf(
[]int32{ignoreFieldNumber},
Expand Down

0 comments on commit b032681

Please sign in to comment.