-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add linter for Go #710
Add linter for Go #710
Conversation
example of working https://github.com/canonical/k8s-snap/pull/722/files |
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 a lot @maci3jka, Almost LGTM. Just minor comments and questions.
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.
Going in the right direction.
Please enable all, see how much issues we get and post that here. Then we can create a PR that branches from this PR and fix all of those issues (if they are straightforward).
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 a lot. This is wonderful. Now we have a shit ton of linting problems to fix. Merging this would cause the k8s-snap pipeline to get stuck in a failing state until everything is fixed which is not good. We can do 2 things:
- Keep the PR open and gradually fix the issues
- Change the base from
main
to a custom branch.
I would go with option 1 because when we're done with the feature branch, rebasing it on main will be a huge pain and is super error prone.
Options 1 is itself challenging tho. We will still need to make sure we constantly rebase on main to prevent a huge and problematic/conflicting rebase later on.
WDYT @bschimke95?
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
I added a list of all linters and disabled them. Now I will gradually enable all of the linters and fix the relevant code pieces as separate PRs. |
This PR improves the development experience. It adds to go checks the linter golangci-lint, aggregating the number of liners and adding annotations on the PR with found issues. Additionally, it introduces
go.lint
target to makefile which allows running the same set of linters locally.