-
Notifications
You must be signed in to change notification settings - Fork 58
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
Address linter issues while moving to golangci version 1.62.0 #1674
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ShyamsundarR
force-pushed
the
linter-3
branch
2 times, most recently
from
November 24, 2024 14:11
a2543b5
to
cd86bad
Compare
nirs
reviewed
Nov 24, 2024
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.
Good to move to latest version, this allows runnign golangci-lint with current go version (1.23).
As part of moving to golangci 1.62.0, errcheck linter flags off the code that is modified here as not checking error returns. This is fixed across the various files to add type safety checks before accessing the variable. Signed-off-by: Shyamsundar Ranganathan <[email protected]>
As part of moving to golangci 1.62.0, gosec flags off the mode used in the code corrected by this commit as too permissive. The mode is now corrected to be less permissive. Signed-off-by: Shyamsundar Ranganathan <[email protected]>
Signed-off-by: Shyamsundar Ranganathan <[email protected]>
Signed-off-by: Shyamsundar Ranganathan <[email protected]>
ShyamsundarR
force-pushed
the
linter-3
branch
from
November 26, 2024 00:07
cd86bad
to
85f596e
Compare
(latest push above is a rebase of existing contents post merge of #1672 ) |
Predominant errors were flagged off as: printf: non-constant format string in call to fmt.Errorf Signed-off-by: Shyamsundar Ranganathan <[email protected]>
Moving to the latest version errors out on inactivated linters (that were deprecated earlier). This required commenting out these linters till we ensure we have enabled the required replacements correctly. The linters that are inacivated (and hence commented out) are: deadcode, execinquery, golint, ifshort, maligned, scopelint, strutcheck, varcheck gomnd is replaced by mnd exportloopref is replaced by copyloopvar, but not enabled in this commit to address linter issues in code. Signed-off-by: Shyamsundar Ranganathan <[email protected]>
ShyamsundarR
force-pushed
the
linter-3
branch
from
November 26, 2024 00:23
85f596e
to
9607fb1
Compare
raghavendra-talur
approved these changes
Nov 26, 2024
nirs
approved these changes
Nov 26, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR moves golangci to 1.62.0 version and addresses issues reported by currently active linters, that are new with the current linter versions.