Skip to content

Commit

Permalink
fix: add commands for generating go types (#16)
Browse files Browse the repository at this point in the history
Co-authored-by: Rootul P <rootulp@gmail.com>
  • Loading branch information
cmwaters and rootulp committed Jan 16, 2024
1 parent 2562fc6 commit 414d7f7
Show file tree
Hide file tree
Showing 12 changed files with 168 additions and 163 deletions.
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.

0 comments on commit 414d7f7

Please sign in to comment.