Utilize native git diff feature (#2981)

This `--exit-code` option does exactly what the script is doing

Signed-off-by: Marco Franssen <marco.franssen@gmail.com>
This commit is contained in:
Marco Franssen
2023-06-06 19:40:25 +04:00
committed by GitHub
parent 06fea26bb0
commit 47a0e067a1
2 changed files with 5 additions and 12 deletions
+5 -5
View File
@@ -100,23 +100,23 @@ bin/protoc-gen-go-grpc:
##@ Verify
verify: generate ## Verify that all the code was generated and committed to repository.
@./scripts/git-diff
@git diff --exit-code
.PHONY: verify-proto
verify-proto: generate-proto ## Verify that the Dex client's protobuf code was generated.
@./scripts/git-diff
@git diff --exit-code
.PHONY: verify-proto
verify-proto-internal: generate-proto-internal ## Verify internal protobuf code for token encoding was generated.
@./scripts/git-diff
@git diff --exit-code
.PHONY: verify-ent
verify-ent: generate-ent ## Verify code for database ORM was generated.
@./scripts/git-diff
@git diff --exit-code
.PHONY: verify-go-mod
verify-go-mod: go-mod-tidy ## Check that go.mod and go.sum formatted according to the changes.
@./scripts/git-diff
@git diff --exit-code
##@ Test and Lint
-7
View File
@@ -1,7 +0,0 @@
#!/bin/bash -e
DIFF=$( git diff . )
if [ "$DIFF" != "" ]; then
echo "$DIFF" >&2
exit 1
fi