-
Notifications
You must be signed in to change notification settings - Fork 940
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
Update static analysis #12011
Comments
I think we decided not to because the action runs |
OK cool. Their page says
https://golangci-lint.run/usage/install/#ci-installation So I'm not sure about always installing the latest version though. |
@tomponline if not always using the latest, we should still update to v1.53.3 as our currently used one is somewhat outdated. |
I'll leave that up to you but I think it's probably best to stay up-to-date automatically and then pin it if we have any issues. |
I agree we should update certainly. It just seems odd they don't recommend auto updating. |
I guess they're saying don't absolutely rely on the latest patch, but it's fairly trivial to pin to an older version while they fix things (for us at least) so 🤷 |
Well lets try the auto update, but if it interrupts our workflow by breaking and requiring manual pinning we can just go back to pinning again. |
This is why they probably recommend pinning: |
I made a start on this a while back for the client package. I think it's an awful lot of work for very little pay off. Most of the work is in deciding what to do with the ignored errors. E.g. if logging, then at what verbosity? Does the called function ever return an error? Might this change in the future? We could take a blanket decision to log all ignored errors at the debug level so that they are at least handled in some way, but this is still a lower priority than any other issue or work item. |
There are a few tasks that can be carried out to improve our static analysis.
First, the
golangci-lint
installation script will automatically select the most recent version if no version is specified. This was implemented for microcloud here. We should also do this for LXD to make sure our linters stay up-to-date.Second, the
errcheck
linter defaults to skip errors that have been explicitly ignored. We have discussed this here and think it would be beneficial to disallow unchecked errors without a //nolint:errcheck directive. This may seem tedious but it will at least prompt us to comment with a reason as to why an error is ignored. Most should be at least logger (see the discussion). PRs for this change should be package-by-package because there are so many.The text was updated successfully, but these errors were encountered: