-
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
chore: setup golangci-lint
with a basic configuration
#262
Conversation
.golangci.yaml
Outdated
@@ -0,0 +1,92 @@ | |||
# todo: this should match the configuration of osv-scanner for the most part |
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.
Create an issue for TODOs and link to the issue in the comment.
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.
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.
Thanks! Can you change the todos in this doc to the format # TODO(#274):
in that case?
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.
done! and I've made a note to check if there's a lint for that 😄
This is a first step towards having a robust linting configuration based off what we have in
osv-scanner
; currently, I've had to disable everything and then manually re-enable specific rules due to the linter throwing many type errors about something - I'm guessing it probably relates to the protobuffer stuff, even though I have been able to get that compiled locally.Regardless this should serve as a good starting point by having linting running and enforcing some lints, along with a commented out list of all the linters that we want to look at getting enabled to match the
osv-scanner
configuration. I created this list by runninggo run github.com/golangci/golangci-lint/cmd/[email protected] linters
, then manually commenting out each linter that has violations until everything was happy.The idea is eventually when all the kinks are worked out we should be able to completely replace this configuration with the one from
osv-scanner
, meaning we shouldn't need to worry about e.g.enable
vspresets
.I will follow this PR up with more that tackle the individual rules, acknowledging there will be some that we probably want to discuss so I'll first try to weed out the ones that should be no-brainers to get enabled.
Relates to #158