gnolang / gno

Gno: An interpreted, stack-based Go virtual machine to build succinct and composable apps + gno.land: a blockchain for timeless code and fair open-source.
https://gno.land/
Other
896 stars 375 forks source link

gno-specific code linters #850

Open thehowl opened 1 year ago

thehowl commented 1 year ago

Kick-starting off this issue off of this discussion. A linter is definitely something we'll want, adding some more checks on top of the kind already done by go linters such as revive.

While I don't necessarily agree about the related discussion, I think we can start collecting ideas about what should be added to a future linter.

One first idea, for the current state of things, is that of not having a top-level variable declaration for a map as it is not persistent.

kristovatlas commented 5 months ago

Type checking PR in progress: https://github.com/gnolang/gno/pull/1730

zivkovicmilos commented 2 months ago

cc @notJoon

notJoon commented 2 months ago

Although it's not revive, I'm continuing to create a lint tool based on gnolangci-lint to support most of linting rules. Recently I've been implementing gno-specific rules and other linting functionalities, like auto fix.

So, in my personal opinion, I think it might be good to move this entirely to the gno side and then integrate with previous tools. What do you think about this?

https://github.com/gnoswap-labs/tlin

cc @zivkovicmilos @thehowl @moul @dongwon8247

zivkovicmilos commented 2 months ago

@notJoon

If I'm understanding correctly, you're suggesting migrating this linter to the gnolang org?

notJoon commented 2 months ago

If I'm understanding correctly, you're suggesting migrating this linter to the gnolang org?

@zivkovicmilos Yes, if possible. If not, I can start over from scratch.

dongwon8247 commented 2 months ago

Makes sense as long as it helps Gno builders.