-
Notifications
You must be signed in to change notification settings - Fork 37
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(fmt): Enable disabled linters in global scope #238
Conversation
Codecov Report
@@ Coverage Diff @@
## main #238 +/- ##
===========================================
- Coverage 55.81% 40.33% -15.49%
===========================================
Files 44 46 +2
Lines 2012 2162 +150
===========================================
- Hits 1123 872 -251
- Misses 781 1230 +449
+ Partials 108 60 -48
Continue to review full report at Codecov.
|
0272eb0
to
4bc0506
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.
Just the 1 comment
.golangci.yml
Outdated
- path: test/e2e/ | ||
linters: | ||
- goerr113 | ||
- gomnd | ||
|
||
linters: | ||
disable-all: true |
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.
Should we flip this and set enable-all: true
so we pick up new linters in the future? And then document any we explicitly disable
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.
enable-all: true
is deprecated
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.
enabled all and disabled a selection of linters.
Global options: * An explanation for all nolint annotations is required. Please do not just ignore it, tell us why is it ignored. == wsl * Fixed everywhere. == lll * Fix everywhere. * Added exception on `https://` links. == gochecknoglobals * Fixed everywhere. == gci * Fixed everywhere (with `golangci-lint run --fix`) == godox No TODO comments should live in the code without filed issues to track them. The reason is simple: if we have a comment with "todo", it has the same value as not having that comment at all, because no one will care about it. * No TODO, BUG, and FIXME comments in the code. * Except if it has a filed github issue reference.
Disabled linters: golint: The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive. interfacer: The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. scopelint: The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref. maligned: fieldalignment tagliatelle: We have a yaml structure already and it uses snake_case keys, this linter wants us to replace with camelCase. That would require a design document and update all yaml outputs. ireturn: Question? nilnil: We are using nil, nil returns in case it was not an error, but the resource does not exist. Later we might want to return an error and check for error type on the caller side. exhaustivestruct: We don't want to specify all fields with nil and empty string. I see the point, if you specify and the default behavior is changed, it does not break the code.
What this PR does / why we need it:
Global options:
wsl
lll
https://
links.gochecknoglobals
gci
golangci-lint run --fix
)godox
No
TODO
comments should live in the code without filed issues to trackthem. The reason is simple: if we have a comment with "todo", it has the
same value as not having that comment at all, because no one will care
about it.
TODO
,BUG
, andFIXME
comments in the code.Disabled linters: see commit message
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #168
Special notes for your reviewer:
Removed some comments, because they are not relevant in the code yet. For example add CSI/CNI/RateLimit, we don't have a ticket about it, it's on a long term list, and when we add them, we can extend those structs (and that will basically part of the ticket), right now those comments had no value.
Checklist: