-
Notifications
You must be signed in to change notification settings - Fork 98
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
Bump golangci-lint #610
Bump golangci-lint #610
Conversation
@here: will require upgrade golangci locally: https://golangci-lint.run/usage/install/#macos |
a0324f9
to
114462a
Compare
closes #609 Golangci-lint has been greatly expanded with new linter types, some of which I have integrated. With the new linters came also changes in the code, mainly - introduction of constants for repeating text - throwing out deprecated code Some of the linters were not suitable and have been commented out - golint is deprecated, revive is instead - whitespace - it's bad to have empty lines in the code, in my opinion it degrades clarity - funlen - watches the length of functions and their names - exhaustive - completing missing constants in the switch (not only default) - gomnd - force to have any number in constant. E.g. mark if len(x) > 2 , - gofmt - is part of goimports I had to change linter configuration for these: - gochecknoinits - it is bothered by wrong use of init function - it is only init() in generated code - dupl - duplicates in the code (this only applies to testing, where duplicates happen frequently. We don't mind it there) In addition I updated build pipeline. Signed-off-by: kuritka <kuritka@gmail.com>
114462a
to
67818b0
Compare
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.
Left couple of comments otherwise looks good
|
||
# don't enable: | ||
# - golint # deprecated | ||
# - whitespace |
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.
why not? :)
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 had problem with empty lines we keep in the code, which delimits block of code, e.g.: we will remove empty lines here: this
@@ -33,7 +33,7 @@ import ( | |||
|
|||
func TestFactoryInfoblox(t *testing.T) { | |||
// arrange | |||
client := fake.NewFakeClientWithScheme(scheme.Scheme, []runtime.Object{}...) | |||
client := fake.NewClientBuilder().WithScheme(scheme.Scheme).WithRuntimeObjects([]runtime.Object{}...).Build() |
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.
Is it dictated by newer fake client version?
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.
It's deprecated. see upstream function in controller runtime: uses NewClientBuilder anyway and comment says it's deprecated. one of the new linters found that.
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
closes #609
Golangci-lint has been greatly expanded with new linter types, some of which I have integrated.
With the new linters came also changes in the code, mainly
Some of the linters were not suitable and have been commented out
I had to change linter configuration for these:
In addition I updated build pipeline.
Signed-off-by: kuritka kuritka@gmail.com