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

Remove support for deprecated options #178

Merged
merged 4 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 0 additions & 1 deletion .github/workflows/buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ jobs:
token: ${{ secrets.BUF_TOKEN }}
format: true
lint: true
breaking: true
push: false
archive: false
- name: Check Generate
Expand Down
4 changes: 0 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ linters:
- wsl # over-generous whitespace violates house style
issues:
exclude-use-default: true
exclude:
# we will continue to support the deprecated field until it's removed
- "IgnoreEmpty is deprecated"
- "Skipped is deprecated"
exclude-rules:
# Loosen requirements on conformance executor
- path: internal/cmd/
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ GOLANGCI_LINT_VERSION ?= v1.60.1
# Set to use a different version of protovalidate-conformance.
# Should be kept in sync with the version referenced in proto/buf.lock and
# 'buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go' in go.mod.
CONFORMANCE_VERSION ?= v0.9.0
CONFORMANCE_VERSION ?= v0.10.0

.PHONY: help
help: ## Describe useful make targets
Expand Down
8 changes: 4 additions & 4 deletions buf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
version: v2
deps:
- name: buf.build/bufbuild/protovalidate
commit: 5a7b106cbb87462d9a8c9ffecdbd2e38
digest: b5:0f2dc6c9453e9cc9e9f36807aaa5f94022e837d91fef4dcaeed79a35c0843cc64eba28ff077aab24da3b2cb12639ad256246f9f9a36c033b99d5754b19996b7e
commit: 63bb56e204954558946a641ef0d68910
digest: b5:ec5661b2855484eca2043fe61d27eb22673ab926ccd0e849531752eb17b08402fae1382705cee7f7b42d4d9ec56aff72bba7ec6835902cf6f86323c9ac682d16
- name: buf.build/bufbuild/protovalidate-testing
commit: 165ebb0f38244fc2a5b23a82cabe812f
digest: b5:4e3e21cabc93277d9069f7ded53c17659fefe47dd8daf9bc534387590feabe971b2d51b88b324835385650f3fa227e8a793a99ca9814cba76ee678f20ba9b4ef
commit: 6106553151724c9480917a13c2fc2d57
digest: b5:6a7a3700d0396fad82118850c2d94263b80ab2d1462220fab1227ef29bd320d85327748fa583a461e6d0084233a3ea8d5c372e85d12f7d64de075420051f9955
- name: buf.build/envoyproxy/protoc-gen-validate
commit: daf171c6cdb54629b5f51e345a79e4dd
digest: b5:c745e1521879f43740230b1df673d0729f55704efefdcfc489d4a0a2d40c92a26cacfeab62813403040a8b180142d53b398c7ca784a065e43823605ee49681de
6 changes: 2 additions & 4 deletions builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,13 +505,11 @@ func (bldr *builder) processRepeatedConstraints(
}

func (bldr *builder) shouldSkip(constraints *validate.FieldConstraints) bool {
return constraints.GetSkipped() ||
constraints.GetIgnore() == validate.Ignore_IGNORE_ALWAYS
return constraints.GetIgnore() == validate.Ignore_IGNORE_ALWAYS
}

func (bldr *builder) shouldIgnoreEmpty(constraints *validate.FieldConstraints) bool {
return constraints.GetIgnoreEmpty() ||
constraints.GetIgnore() == validate.Ignore_IGNORE_IF_UNPOPULATED ||
return constraints.GetIgnore() == validate.Ignore_IGNORE_IF_UNPOPULATED ||
constraints.GetIgnore() == validate.Ignore_IGNORE_IF_DEFAULT_VALUE
}

Expand Down
2 changes: 0 additions & 2 deletions error_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ func finalizeViolationPaths(err error) {
for _, violation := range valErr.Violations {
if violation.Proto.GetField() != nil {
slices.Reverse(violation.Proto.GetField().GetElements())
//nolint:staticcheck // Intentional use of deprecated field
violation.Proto.FieldPath = proto.String(fieldPathString(violation.Proto.GetField().GetElements()))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/bufbuild/protovalidate-go
go 1.21.1

require (
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.4-20241127180247-a33202765966.1
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.4-20250130201111-63bb56e20495.1
github.com/envoyproxy/protoc-gen-validate v1.2.1
github.com/google/cel-go v0.23.0
github.com/stretchr/testify v1.10.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.4-20241127180247-a33202765966.1 h1:yeaeyw0RQUe009ebxBQ3TsqBPptiNEGsiS10t+8Htuo=
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.4-20241127180247-a33202765966.1/go.mod h1:novQBstnxcGpfKf8qGRATqn1anQKwMJIbH5Q581jibU=
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.4-20250130201111-63bb56e20495.1 h1:4erM3WLgEG/HIBrpBDmRbs1puhd7p0z7kNXDuhHthwM=
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.4-20250130201111-63bb56e20495.1/go.mod h1:novQBstnxcGpfKf8qGRATqn1anQKwMJIbH5Q581jibU=
cel.dev/expr v0.19.1 h1:NciYrtDRIR0lNCnH1LFJegdjspNx9fI59O7TWcua/W4=
cel.dev/expr v0.19.1/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw=
github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI=
Expand Down
2 changes: 1 addition & 1 deletion internal/gen/buf/validate/conformance/cases/bytes.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading