-
Notifications
You must be signed in to change notification settings - Fork 1
chore: update golangci-lint to v2.3.0 [IDE-1377] #115
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
base: main
Are you sure you want to change the base?
Conversation
Migrate stylecheck, gosimple, and varcheck into staticcheck (they are now all combined). Add unused linter with `exported-fields-are-used: false`, this is to replace varcheck's `exported-fields: true`. Enable staticcheck explicitly, it was previously enabled, but was not listed. Remove deprecated `EXC####` exclusion rules. Disable package comment rules (ST1000). Disable naming convention rules (ST1003). Move the timeout to command-line arguments (v2 discourages timeouts in the config). Re-enable stuttering checks. Fix any new lint errors.
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) ✅ code/snyk check is complete. No issues have been found. (View Details) |
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.
LGTM
| - unconvert | ||
| # TODO(unparam): revisit | ||
| #- unparam | ||
| - unused |
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.
You can safely remove the - unused line from your linters.enable section because it's already covered by staticcheck with checks: ['all'].
Unless you really want it to be explicit.
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.
Man, I really dislike these linters being enabled without you actually realising it... I got confused multiple times during this task about why I was seeing lint rules for things I had removed...
I don't know if it is better to be explicit or not, I will let you decide.
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.
These linters do not need to be listed.
Linters you can safely remove:
- unused (line 150) - Already covered by staticcheck
- gosimple - Not explicitly listed, but if it were, it would be redundant
- stylecheck - Not explicitly listed, but if it were, it would be redundant
All other linters in your configuration provide unique functionality not covered by staticcheck.
Id think either list all linters that can be listed (that are in use), or don't list linters that are enabled by staticcheck already?
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.
I was going to remove it and then I realised it feels weird to have unused listed in the settings, but not in the list of enabled linters. To someone who doesn't know better, this would look like a mistake.
I could add a comment on line 77 that it is enabled by staticcheck, would that be better than just listing it here even though it is redundant?
…ci-lint-v2-3-0 Fix linting
Previously a redownload would happen after the contents of the directory changed.
Description
Migrate stylecheck, gosimple, and varcheck into staticcheck (they are now all combined).
Add unused linter with
exported-fields-are-used: false, this is to replace varcheck'sexported-fields: true.Enable staticcheck explicitly, it was previously enabled, but was not listed.
Remove deprecated
EXC####exclusion rules.Disable package comment rules (ST1000).
Disable naming convention rules (ST1003).
Move the timeout to command-line arguments (v2 discourages timeouts in the config).
Re-enable stuttering checks.
Fix any new lint errors.
Plus make pact install fails fail the make target.
Notes for the reviewer
I would recommend comparing
.golangci.yamlwith whitespace ignored.Migration guide: https://golangci-lint.run/docs/product/migration-guide/
Checklist
🚨After having merged, please update the
snyk-lsand CLI go.mod to pull in latest client.