-
Notifications
You must be signed in to change notification settings - Fork 108
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
style: cleanup code by golangci-lint #797
base: main
Are you sure you want to change the base?
Conversation
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.
Triage notes
- thank you @Dreamacro – parking for now as we are unsure if we want to manually add this to every go repo
- @galargh thoughts if this could/should be part of Unified CI for GO instead?
We could merge the fixes without the CI changes for now? |
@hsanjuan I'll revert the CI changes later. |
528dbb8
to
539b736
Compare
done |
539b736
to
c591403
Compare
It might be also worth considering making golangci-lint workflow part of the go-check, and exposing the linter selection to the workflow users. One thing that I think we should keep in mind during that process is the quality of the local development iteration. We definitely want some level of static checking of the code, but we also don't want the checks to negatively impact the contribution experience. |
As described in #775,
boxo
requires a better static code analysis tool since the currently usedipdxco/unified-github-workflows
has limitation capabilities.Therefore, I am attempting to use
golangci-lint
here (while retaining the original ipdxco/unified-github-workflows). I have disabled allgolangci-lint
default configurations and enabled some checks that I find particularly valuable.golangci-lint config
After performing the lint fixes,
boxo
generally has the following issues:gci
can fix this.for example:
boxo/ipld/unixfs/io/dagreader_test.go
Lines 3 to 15 in 8ca0ca2
unconvert
.There might be some other valuable plugins, such as
unused
, and I would like to hear your opinions on them.