diff --git a/.github/workflows/build_template.yml b/.github/workflows/build_template.yml index a2c96f2d37e..454e76b84da 100644 --- a/.github/workflows/build_template.yml +++ b/.github/workflows/build_template.yml @@ -23,7 +23,8 @@ jobs: - name: Check generated files are up to date working-directory: ${{ inputs.modulepath }} run: | - go generate -x ./... + make generate + if [ "$(git status -s)" != "" ]; then echo "command 'go generate' creates file that differ from git tree, please run 'go generate' and commit:" git status -s diff --git a/gno.land/Makefile b/gno.land/Makefile index 075560f44a9..90ba7451c35 100644 --- a/gno.land/Makefile +++ b/gno.land/Makefile @@ -50,9 +50,13 @@ install.gnokey:; go install ./cmd/gnokey .PHONY: dev.gnoweb generate.gnoweb dev.gnoweb: make -C ./pkg/gnoweb dev -generate.gnoweb: + +.PHONY: generate +generate: + go generate -x ./... make -C ./pkg/gnoweb generate + .PHONY: fclean fclean: clean rm -rf gnoland-data genesis.json diff --git a/gnovm/Makefile b/gnovm/Makefile index 2206fa2c8c8..fa77045d067 100644 --- a/gnovm/Makefile +++ b/gnovm/Makefile @@ -128,7 +128,7 @@ _test.filetest:; # TODO: move _dev.stringer to go:generate instructions, simplify generate # to just go generate. .PHONY: generate -generate: _dev.stringer _dev.generate _dev.docs +generate: _dev.stringer _dev.generate _dev.docs fmt imports .PHONY: _dev.docs _dev.docs: diff --git a/gnovm/pkg/gnolang/internal/softfloat/runtime_softfloat64_test.go b/gnovm/pkg/gnolang/internal/softfloat/runtime_softfloat64_test.go index 8b5d34650f1..70c76655a97 100644 --- a/gnovm/pkg/gnolang/internal/softfloat/runtime_softfloat64_test.go +++ b/gnovm/pkg/gnolang/internal/softfloat/runtime_softfloat64_test.go @@ -10,11 +10,12 @@ package softfloat_test import ( - . "github.com/gnolang/gno/gnovm/pkg/gnolang/internal/softfloat" "math" "math/rand" "runtime" "testing" + + . "github.com/gnolang/gno/gnovm/pkg/gnolang/internal/softfloat" ) // turn uint64 op into float64 op diff --git a/gnovm/tests/stdlibs/README.md b/gnovm/tests/stdlibs/README.md index 8742447e59a..d264cf35c45 100644 --- a/gnovm/tests/stdlibs/README.md +++ b/gnovm/tests/stdlibs/README.md @@ -5,4 +5,4 @@ available when testing gno code in `_test.gno` and `_filetest.gno` files. Re-declarations of functions already existing override the definitions of the normal stdlibs directory. -Adding imports that don't exist in the corresponding normal stdlib is undefined behavior \ No newline at end of file +Adding imports that don't exist in the corresponding normal stdlib is undefined behavior diff --git a/tm2/Makefile b/tm2/Makefile index 0aaa63e5285..fd3aede0d4c 100644 --- a/tm2/Makefile +++ b/tm2/Makefile @@ -63,3 +63,8 @@ _test.pkg.others:; go test $(GOTEST_FLAGS) `go list ./pkg/... | grep -Ev 'pkg/( _test.pkg.amino:; go test $(GOTEST_FLAGS) ./pkg/amino/... _test.pkg.bft:; go test $(GOTEST_FLAGS) ./pkg/bft/... _test.pkg.db:; go test $(GOTEST_FLAGS) ./pkg/db/... ./pkg/iavl/benchmarks/... + +.PHONY: generate +generate: + go generate -x ./... + $(MAKE) fmt diff --git a/tm2/pkg/overflow/overflow_impl.go b/tm2/pkg/overflow/overflow_impl.go index 0f057f65387..ab9f13c163d 100644 --- a/tm2/pkg/overflow/overflow_impl.go +++ b/tm2/pkg/overflow/overflow_impl.go @@ -84,10 +84,9 @@ func Quotient8(a, b int8) (int8, int8, bool) { } c := a / b status := (c < 0) == ((a < 0) != (b < 0)) || (c == 0) // no sign check for 0 quotient - return c, a%b, status + return c, a % b, status } - // Add16 performs + operation on two int16 operands, returning a result and status. func Add16(a, b int16) (int16, bool) { c := a + b @@ -170,10 +169,9 @@ func Quotient16(a, b int16) (int16, int16, bool) { } c := a / b status := (c < 0) == ((a < 0) != (b < 0)) || (c == 0) // no sign check for 0 quotient - return c, a%b, status + return c, a % b, status } - // Add32 performs + operation on two int32 operands, returning a result and status. func Add32(a, b int32) (int32, bool) { c := a + b @@ -256,10 +254,9 @@ func Quotient32(a, b int32) (int32, int32, bool) { } c := a / b status := (c < 0) == ((a < 0) != (b < 0)) || (c == 0) // no sign check for 0 quotient - return c, a%b, status + return c, a % b, status } - // Add64 performs + operation on two int64 operands, returning a result and status. func Add64(a, b int64) (int64, bool) { c := a + b @@ -342,6 +339,5 @@ func Quotient64(a, b int64) (int64, int64, bool) { } c := a / b status := (c < 0) == ((a < 0) != (b < 0)) || (c == 0) // no sign check for 0 quotient - return c, a%b, status + return c, a % b, status } -