Skip to content

Commit 6ccbdeb

Browse files
committed
refactor: devtool: re-generate all
1 parent b24b4e0 commit 6ccbdeb

File tree

7 files changed

+341
-356
lines changed

7 files changed

+341
-356
lines changed

.github/workflows/baisc_checks.yml

+6-17
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,15 @@ jobs:
2727
- name: tests-shared
2828
run: make test-venus-shared
2929

30-
- name: compatible-checks
30+
- name: compatible all
3131
run: |
3232
make compatible-all
33-
git --no-pager diff
34-
git --no-pager diff --quiet
3533
36-
- name: check api docs
34+
- name: gen all
3735
run: |
38-
make api-docs
39-
git --no-pager diff
40-
git --no-pager diff --quiet
36+
make gen-all
4137
42-
- name: check cbor-gen
38+
- name: detect changes
4339
run: |
44-
make cborgen
45-
git --no-pager diff
46-
git --no-pager diff --quiet
47-
48-
- name: check mock pai
49-
run: |
50-
make mock-api-gen
51-
git --no-pager diff
52-
git --no-pager diff --quiet
40+
git status --porcelain
41+
test -z "$(git status --porcelain)"

Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ clean:
2424
rm -rf ./extern/filecoin-ffi
2525
rm -rf ./extern/test-vectors
2626

27+
gen-all: cborgen gogen inline-gen api-gen api-docs-gen
28+
2729
gen-asset:
2830
go-bindata -pkg=asset -o ./fixtures/asset/asset.go ./fixtures/_assets/car/ ./fixtures/_assets/proof-params/ ./fixtures/_assets/arch-diagram.monopic
2931
gofmt -s -l -w ./fixtures/asset/asset.go
@@ -45,14 +47,12 @@ inline-gen:
4547
test-venus-shared:
4648
cd venus-shared && go test -covermode=set ./...
4749

48-
gen-api:
49-
cd ./venus-devtool/ && go run ./api-gen/
50-
gofmt -s -l -w ./venus-shared/api/chain/v0/proxy_gen.go;
51-
gofmt -s -l -w ./venus-shared/api/chain/v1/proxy_gen.go
50+
api-gen:
51+
cd ./venus-devtool/ && go run ./api-gen/ proxy
5252

5353
v0APIDoc = ../venus-shared/api/v0-api-document.md
5454
v1APIDoc = ../venus-shared/api/v1-api-document.md
55-
api-docs:
55+
api-docs-gen:
5656
cd ./venus-devtool/ && go run ./api-docs-gen/cmd ../venus-shared/api/chain/v0/fullnode.go FullNode v0 ../venus-shared/api/chain/v0 $(v0APIDoc)
5757
cd ./venus-devtool/ && go run ./api-docs-gen/cmd ../venus-shared/api/chain/v1/fullnode.go FullNode v1 ../venus-shared/api/chain/v1 $(v1APIDoc)
5858

venus-devtool/api-gen/proxy.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ func writeStruct(dst *bytes.Buffer, ifaceMeta *util.InterfaceMeta, astMeta *util
205205
return fmt.Errorf("write func %s: %w", meth.Name, err)
206206
}
207207

208-
fmt.Fprintf(dst, " `perm:%s`\n", util.GetAPIMethodPerm(meth))
208+
fmt.Fprintf(dst, " `perm:\"%s\"`\n", util.GetAPIMethodPerm(meth))
209209
}
210210

211211
fmt.Fprint(dst, structInternalTail)

venus-shared/api/chain/v0/fullnode.go

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package v0
22

3-
//go:generate go run github.com/golang/mock/mockgen@v1.6.0 -destination=./mock/full.go -package=mock . FullNode
4-
53
type FullNode interface {
64
IBlockStore
75
IChain

venus-shared/api/chain/v0/proxy_gen.go

+163-163
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

venus-shared/api/chain/v1/fullnode.go

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package v1
22

3-
//go:generate go run github.com/golang/mock/mockgen@v1.6.0 -destination=./mock/full.go -package=mock . FullNode
4-
53
type FullNode interface {
64
IBlockStore
75
IChain

venus-shared/api/chain/v1/proxy_gen.go

+166-166
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)