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

other: reenable proper make proto-check #1117

Closed
wants to merge 1 commit into from
Closed
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 .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ Dockerfile
scripts/
.vscode/
.github/
proto/
32 changes: 12 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,27 +122,19 @@ proto-gen:
@$(protoImage) sh ./scripts/protocgen.sh;

proto-check:
@if git diff --quiet --exit-code main...HEAD -- proto; then \
echo "Pass! No committed changes found in /proto directory between the currently checked out branch and main."; \
@if git diff --quiet; then \
echo "No files were modified before running 'make proto-gen'."; \
else \
echo "Committed changes found in /proto directory between the currently checked out branch and main."; \
modified_protos=$$(git diff --name-only main...HEAD proto); \
modified_pb_files= ; \
for proto_file in $${modified_protos}; do \
proto_name=$$(basename "$${proto_file}" .proto); \
pb_files=$$(find x/ccv -name "$${proto_name}.pb.go"); \
for pb_file in $${pb_files}; do \
if git diff --quiet --exit-code main...HEAD -- "$${pb_file}"; then \
echo "Missing committed changes in $${pb_file}"; \
exit 1; \
else \
modified_pb_files+="$${pb_file} "; \
fi \
done \
done; \
echo "Pass! Correctly modified pb files: "; \
echo $${modified_pb_files}; \
fi
echo "Error: Uncommitted changes exist before running 'make proto-gen'. Please commit or stash your changes."; \
exit 1; \
fi
@$(MAKE) proto-gen
@if git diff --quiet; then \
echo "No files were modified after running 'make proto-gen'. Pass!"; \
else \
echo "Error: Files were modified after running 'make proto-gen'. Please commit changes to .pb files"; \
exit 1; \
fi

proto-format:
@echo "Formatting Protobuf files"
Expand Down