-
Notifications
You must be signed in to change notification settings - Fork 33
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
feat: use stricter go linter configuration. #807
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #807 +/- ##
==========================================
- Coverage 70.37% 70.33% -0.05%
==========================================
Files 19 19
Lines 1708 1719 +11
==========================================
+ Hits 1202 1209 +7
- Misses 388 393 +5
+ Partials 118 117 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Not bad! I think it looks nice
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.
Great work!
A couple of comments added
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 modulo Fabrizio's comments. I'm ok on punting on the funlen.
838497f
to
df2782d
Compare
@fabriziosestito @flavio @viccuad can you review it again? I've noticed that the golangci.yml file that I've added in this PR was not the latest one. I've copied the version from spinkube repository. Now, I've copied the one from Marat Reymers gist and fix everything new that shown up. |
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. Although I find weird to go with an allow-list for linters instead of deny-list.
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.
Great work!
Love the approach of excluding linters in the configuration file for tests, but keeping the explicit nolint commits for the controller code with an explanation,
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 like the change. I'm fine having an allow list, since the configuration of golangci changes A LOT between release, causing quite some problems when new linters are added out of the blue
Updates the golang linter configuration to be more stricter. The used configuration is originally written by Marat Reymers Signed-off-by: José Guilherme Vanz <jguilhermevanz@suse.com>
Adapts the golden config for golang linter from Marat Reymers to the Kubewarden project. Signed-off-by: José Guilherme Vanz <jguilhermevanz@suse.com>
Removes an issue spot by the Go lang linter about using a global variable. Signed-off-by: José Guilherme Vanz <jguilhermevanz@suse.com>
Fix the code base after updating the Golang linter configuration. Signed-off-by: José Guilherme Vanz <jguilhermevanz@suse.com>
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.
ship it 🚀
Description
Updates the Go lang linter to stricter configuration. Also, updates the controller code to make the linter happy again.
Fix #778
Test
Additional Information
I've removed some
exclude-rules
not used from the suggested configuration file to be used. As well as, disabled thetestpackage
linter. I don't think we need it for now.Keep in mind that some changed lines are
go fmt
output. ;)