gno icon indicating copy to clipboard operation
gno copied to clipboard

feat(gnovm): add `gno fmt` command

Open gfanton opened this issue 1 year ago • 2 comments

Add gno fmt as an experimental feature inside the contribs folder. For now, it only supports the example folder along with stdlibs. In the future, it should possibly support:

  • An include flag to specify a directory that gno fmt should be aware of.
  • Specify a target chain so it can update imports based on what's on the chain (or using a gnoproxy).

gnoimports

Contributors' checklist...
  • [ ] Added new tests, or not needed, or not feasible
  • [ ] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • [ ] Updated the official documentation or not needed
  • [ ] No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • [ ] Added references to related issues and PRs
  • [ ] Provided any useful hints for running manual tests
  • [ ] Added new benchmarks to generated graphs, if any. More info here.

gfanton avatar May 20 '24 22:05 gfanton

Codecov Report

Attention: Patch coverage is 53.33333% with 238 lines in your changes missing coverage. Please review.

Project coverage is 54.70%. Comparing base (f6ca518) to head (0386979).

Files Patch % Lines
gnovm/cmd/gno/fmt.go 55.00% 61 Missing and 11 partials :warning:
gnovm/pkg/gnofmt/processor.go 59.00% 49 Missing and 17 partials :warning:
gnovm/pkg/gnofmt/resolver.go 0.00% 42 Missing :warning:
gnovm/pkg/gnofmt/package.go 49.29% 25 Missing and 11 partials :warning:
gnovm/cmd/gno/util.go 55.55% 13 Missing and 3 partials :warning:
gnovm/pkg/gnofmt/resolver_mock.go 83.87% 4 Missing and 1 partial :warning:
gnovm/cmd/gno/transpile.go 0.00% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2156      +/-   ##
==========================================
- Coverage   54.73%   54.70%   -0.03%     
==========================================
  Files         584      590       +6     
  Lines       78531    79036     +505     
==========================================
+ Hits        42983    43236     +253     
- Misses      32336    32550     +214     
- Partials     3212     3250      +38     
Flag Coverage Δ
contribs/gnodev 23.81% <ø> (ø)
contribs/gnofaucet 15.31% <ø> (+0.85%) :arrow_up:
contribs/gnokeykc 0.00% <ø> (ø)
contribs/gnomd 0.00% <ø> (ø)
gno.land 62.68% <ø> (ø)
gnovm 59.80% <53.33%> (-0.18%) :arrow_down:
misc/autocounterd 0.00% <ø> (ø)
misc/genproto 0.00% <ø> (ø)
misc/genstd 73.90% <ø> (ø)
misc/goscan 0.00% <ø> (ø)
misc/logos 17.68% <ø> (ø)
misc/loop 0.00% <ø> (ø)
tm2 54.45% <ø> (-0.07%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 20 '24 22:05 codecov[bot]

I recommend renaming contribs/gnoimports to gno fmt to include gnoimports in our only official formatter. In the help message for gno fmt, explicitly mention that it includes gnoimports functionality. Additionally, integrate the checking part of gnoimports into gno lint for IDEs to detect issues.

moul avatar May 21 '24 15:05 moul