openly-engineering / openlynt

Go lint tool with customizable rules.
MIT License
1 stars 0 forks source link

[refactor] build on top of golang.org/x/tools/go/analysis #5

Open chrsm opened 4 years ago

chrsm commented 4 years ago

So far we've implemented our lint rules manually - and a frontend to match.

The analysis package implements numerous checkers that serve as great examples - and ways to run them (and custom ones) via the analysis/multichecker and analysis/singlechecker packages.

Instead of rolling our own, we should attempt to use this interface.

chrsm commented 4 years ago

Working on this in chrsm/go-analysis

chrsm commented 4 years ago

It looks like we'll need to write a tiny frontend similar to analysis/multichecker to support our yaml-based config format. This shouldn't be too challenging, as all cmd/openlynt does is parse the yaml and run ast.Inspect.

toejough commented 4 years ago

after the refactor we can follow the example at https://github.com/golangci/golangci-lint/blob/master/pkg/golinters/govet.go if we ever want to submit a PR for integration with golangci-lint

chrsm commented 4 years ago

:+1: it'd be pretty awesome to get ours in there!