Skip to content

Commit

Permalink
chore: fmt (#3578)
Browse files Browse the repository at this point in the history
for the context, i was trying to fix these unrelated PR diffs:
https://github.com/gnolang/gno/pull/3176/files#diff-adbe9861bf11ff27b97aafd5a5e8bbe30dca0474c3008cd066f7fd8863b8b3d0L1,
then I noticed #3577.

This PR:
- reformats the generated files
- updates the makefiles to ensure that `make generate` will also format
the generated files
- updates the CI to check for both formatted and generated files
- [x] Depends on #3577 
- [x] Depends on #3584

---------

Signed-off-by: moul <[email protected]>
  • Loading branch information
moul authored Feb 9, 2025
1 parent be61d7d commit 52fca76
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 22 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion gno.land/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gnovm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
19 changes: 10 additions & 9 deletions gnovm/cmd/gno/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ USAGE
gno <command> [arguments]
SUBCOMMANDS
bug start a bug report
clean remove generated and cached data
doc show documentation for package or symbol
env print gno environment information
fmt gnofmt (reformat) package sources
mod module maintenance
run run gno packages
test test packages
tool run specified gno tool
bug start a bug report
clean remove generated and cached data
doc show documentation for package or symbol
env print gno environment information
fmt gnofmt (reformat) package sources
mod module maintenance
run run gno packages
test test packages
tool run specified gno tool
version display installed gno version
```

Expand Down

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

2 changes: 1 addition & 1 deletion gnovm/tests/stdlibs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Adding imports that don't exist in the corresponding normal stdlib is undefined behavior
5 changes: 5 additions & 0 deletions tm2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 4 additions & 8 deletions tm2/pkg/overflow/overflow_impl.go

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

0 comments on commit 52fca76

Please sign in to comment.