Skip to content
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

Merged
merged 1 commit into from
May 6, 2024
Merged

Conversation

ccoVeille
Copy link
Contributor

see #116

@ccoVeille
Copy link
Contributor Author

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"

@mfridman
Copy link
Owner

Thanks, I typically get to these PR's on the weekend, hence the delay.

@ccoVeille
Copy link
Contributor Author

No problems, thanks for letting me know.

@ccoVeille
Copy link
Contributor Author

how was your weekend ? 😁

@mfridman mfridman merged commit 10e190b into mfridman:main May 6, 2024
3 checks passed
@mfridman
Copy link
Owner

mfridman commented May 6, 2024

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
Copy link
Owner

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

@mfridman mfridman mentioned this pull request May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants