-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install and configure golangci-lint #118
Conversation
for now, I didn't add it to the GitHub CI I would expect it to be merged and tested first Please note, it would report a bunch of errors to be addressed: $ make lint
main.go:36:2: var `ciPtr` is unused (unused)
ciPtr = flag.String("ci", "", "")
^
internal/check/check.go:33:37: use-any: since GO 1.18 'interface{}' can be replaced by 'any' (revive)
func Number(t *testing.T, got, want interface{}) {
^
internal/check/check.go:48:38: use-any: since GO 1.18 'interface{}' can be replaced by 'any' (revive)
func NumberNotZero(t *testing.T, got interface{}) {
^
internal/check/check.go:73:36: use-any: since GO 1.18 'interface{}' can be replaced by 'any' (revive)
func Equal(t *testing.T, got, want interface{}) {
^
internal/app/table_tests.go:10: File is not `gci`-ed with --skip-generated -s standard -s default -s prefix(github.com/mfridman) (gci)
"github.com/charmbracelet/lipgloss"
internal/app/table_summary.go:11: File is not `gci`-ed with --skip-generated -s standard -s default -s prefix(github.com/mfridman) (gci)
"github.com/mfridman/tparse/parse"
internal/app/table_summary.go:12: File is not `gci`-ed with --skip-generated -s standard -s default -s prefix(github.com/mfridman) (gci)
"github.com/olekukonko/tablewriter" |
Thanks, I typically get to these PR's on the weekend, hence the delay. |
No problems, thanks for letting me know. |
how was your weekend ? 😁 |
Thanks, let's give it a try. I'll fix up the errors and also move over to testify since it's so widely used (granted I wish something better came along). |
tools: | ||
# Install latest golangci-lint with recommended method https://golangci-lint.run/welcome/install/#local-installation | ||
# Only install it if missing, as we don't want to mess up with any local existing golangci-lint version | ||
@which golangci-lint 2>/dev/null || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nowadays, I typically prefer the tools-method described here: golang/go#25922
But hope to see this proposal see the light of day: golang/go#48429
see #116