Skip to content

Commit

Permalink
Proto add full package name to import (#98)
Browse files Browse the repository at this point in the history
* proto: Add full package name to go package

* make: Add protoc linter

* make: Add help target

* proto: Update go import path

* example: Update example proto and fix tests

* flatten: Remove lookup for outdated proto fields
  • Loading branch information
cdamian authored Nov 23, 2022
1 parent 93cd509 commit 96df725
Show file tree
Hide file tree
Showing 12 changed files with 3,030 additions and 1,751 deletions.
27 changes: 24 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
lint-check: ## runs linters on go code
@gometalinter --disable-all --enable=golint --enable=goimports --enable=vet --enable=nakedret \
--enable=staticcheck --vendor --skip=resources --skip=testingutils --skip=protobufs --deadline=1m ./...;
.PHONY: help install_protoc_deps proto-lint proto

help: ## Show this help message.
@echo 'usage: make [target] ...'
@echo
@echo 'targets:'
@egrep '^(.+)\:\ ##\ (.+)' ${MAKEFILE_LIST} | column -t -c 2 -s ':#'

install-protoc-deps: ## Installs all protobuf dependencies
@go install github.com/ckaznocha/[email protected]
@go install google.golang.org/protobuf/cmd/[email protected]

proto-lint: ## Lint protos
@protoc --lint_out=. proofs/proto/*.proto

proto: ## Compile protos
@protoc -Iproofs/proto \
--go_out=paths=source_relative:proofs/proto \
proofs/proto/*.proto

proto-example:
@protoc -I./ \
--go_out=paths=source_relative:. \
examples/documents/example.proto
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ See below code sample (`examples/simple.go`) for a usage example. For detailed u

## Development
### Building protobuf messages
If the protobuf messages are ever changed, the recommended procedure is to build them using prototools. Use
prototools version 1.3.0 and execute the command `prototol generate` to udpate both the example and the proofs
messages.
If the protobuf messages are ever changed, the recommended procedure is to build them via the targets provided in the [Makefile](Makefile).

`make install_protoc_deps` to install the `protoc` deps.

`make proto` to compile the proto fies.


Loading

0 comments on commit 96df725

Please sign in to comment.