Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
buildbreaker committed Aug 2, 2023
1 parent 84e5038 commit 6b49a3e
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ help: ## Describe useful make targets
.PHONY: generate
generate: generate-license ## Regenerate code and license headers
buf generate --template buf.gen.yaml buf.build/bufbuild/protovalidate
buf generate --template buf.gen.yaml -o conformance/ buf.build/bufbuild/protovalidate-testing
buf generate --template conformance/buf.gen.yaml -o conformance/ buf.build/bufbuild/protovalidate-testing
.PHONY: lint
lint: ## Lint code
./gradlew spotlessCheck
Expand Down
7 changes: 7 additions & 0 deletions conformance/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: v1
managed:
enabled: true
java_package_prefix: "build"
plugins:
- plugin: buf.build/protocolbuffers/java:v23.4
out: src/main/java
14 changes: 7 additions & 7 deletions conformance/src/main/java/build/buf/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@

package build.buf;

import build.buf.validate.ValidateProto;
import build.buf.validate.Violations;
import build.buf.validate.conformance.harness.TestConformanceRequest;
import build.buf.validate.conformance.harness.TestConformanceResponse;
import build.buf.validate.conformance.harness.TestResult;
import build.buf.protovalidate.Config;
import build.buf.protovalidate.ValidationResult;
import build.buf.protovalidate.Validator;
import build.buf.protovalidate.exceptions.CompilationException;
import build.buf.protovalidate.exceptions.ExecutionException;
import build.buf.validate.ValidateProto;
import build.buf.validate.Violation;
import build.buf.validate.Violations;
import build.buf.validate.conformance.harness.TestConformanceRequest;
import build.buf.validate.conformance.harness.TestConformanceResponse;
import build.buf.validate.conformance.harness.TestResult;
import com.google.common.base.Splitter;
import com.google.errorprone.annotations.FormatMethod;
import com.google.protobuf.Any;
Expand Down Expand Up @@ -93,9 +93,9 @@ private static TestResult validate(Validator validator, DynamicMessage dynamicMe
if (violations.isEmpty()) {
return TestResult.newBuilder().setSuccess(true).build();
} else {
Violations error = Violations.newBuilder().addAllViolations(violations).build();
return TestResult.newBuilder()
.setValidationError(
Violations.newBuilder().addAllViolations(violations).build())
.setValidationError(error)
.build();
}
} catch (CompilationException e) {
Expand Down
10 changes: 4 additions & 6 deletions src/main/java/build/buf/validate/ExpressionProto.java

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

8 changes: 3 additions & 5 deletions src/main/java/build/buf/validate/ValidateProto.java

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

11 changes: 4 additions & 7 deletions src/main/java/build/buf/validate/priv/PrivateProto.java

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

0 comments on commit 6b49a3e

Please sign in to comment.