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

fix: add commands for generating go types #16

Merged
merged 4 commits into from
Jan 16, 2024
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
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
DOCKER := $(shell which docker)
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf:1.28.1

## proto-gen-docker: Generate protobuf files. Requires docker.
proto-gen:
@echo "--> Generating Protobuf files"
$(DOCKER_BUF) generate
.PHONY: proto-gen-docker

## proto-lint-docker: Lint protobuf files. Requires docker.
proto-lint:
@echo "--> Linting Protobuf files"
@$(DOCKER_BUF) lint
.PHONY: proto-lint
2 changes: 1 addition & 1 deletion merkle/proto/buf.gen.yaml → buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: v1
plugins:
- plugin: buf.build/protocolbuffers/go
out: gen
out: .
opt:
- paths=source_relative
5 changes: 2 additions & 3 deletions buf.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
version: v1
roots:
-proto
name: buf.build/celestiaorg/go-square
breaking:
use:
- FILE
lint:
use:
- DEFAULT
- BASIC
2 changes: 1 addition & 1 deletion merkle/proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"errors"
"fmt"

wire "github.com/celestiaorg/go-square/merkle/proto/gen/merkle/v1"
wire "github.com/celestiaorg/go-square/merkle/proto"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion merkle/proof_op.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"errors"
"fmt"

wire "github.com/celestiaorg/go-square/merkle/proto/gen/merkle/v1"
wire "github.com/celestiaorg/go-square/merkle/proto"
)

//----------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion merkle/proof_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"testing"

wire "github.com/celestiaorg/go-square/merkle/proto/gen/merkle/v1"
wire "github.com/celestiaorg/go-square/merkle/proto"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/proto"
Expand Down
2 changes: 1 addition & 1 deletion merkle/proof_value.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"crypto/sha256"
"fmt"

wire "github.com/celestiaorg/go-square/merkle/proto/gen/merkle/v1"
wire "github.com/celestiaorg/go-square/merkle/proto"
"google.golang.org/protobuf/proto"
)

Expand Down
156 changes: 78 additions & 78 deletions merkle/proto/gen/merkle/v1/proof.pb.go → merkle/proto/proof.pb.go

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
syntax = "proto3";
package square.merkle;
package merkle.proto;

option go_package = "github.com/celestiaorg/go-square/merkle";

Expand Down
136 changes: 67 additions & 69 deletions pkg/blob/blob.pb.go

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

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
syntax = "proto3";
package square.blob.v1;
package pkg.blob;

option go_package = "github.com/celestiaorg/go-square/pkg/blob";

Expand Down
6 changes: 0 additions & 6 deletions proto/buf.gen.yaml

This file was deleted.

Loading