-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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: deprecate varcheck, deadcode, and structcheck #3125
Conversation
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 this change but curious about the reasoning for modifying default linters not being a breaking change. Breaking default behavior is usually a reason to reject suggestions and push them to v2 (f.e.x modifying or changing exclude use defaults) so this feels a bit inconsistent.
Won't //nolint
directives for non enabled linters yield a warning by nolintlint
?
In fact, Another point, as they are in the default linters, deprecation warnings will appear even if you are not using any configuration. yes |
Yeah I get that the analysis result might be the same but the change can still result in changes that breaks CI or other workflows.
Yup, and this is a great reason to disable them by default if deprecating, if not that would be a pretty bad user experience.
Yeah me neither. Someone running without configuration and Maybe |
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.
Change is good, resonable deprecation. As discussed might introduce breaking changes but I trust your judgment around this change!
The linters have not been updated in 3-6 years and have been deprecated. golangci/golangci-lint#3125
The linters have not been updated in 3-6 years and have been deprecated. golangci/golangci-lint#3125
The linters have not been updated in 3-6 years and have been deprecated. golangci/golangci-lint#3125
The linters have not been updated in 3-6 years and have been deprecated. golangci/golangci-lint#3125
The linters have not been updated in 3-6 years and have been deprecated. golangci/golangci-lint#3125
The linters have not been updated in 3-6 years and have been deprecated. golangci/golangci-lint#3125
The linters have not been updated in 3-6 years and have been deprecated. golangci/golangci-lint#3125
The linters have not been updated in 3-6 years and have been deprecated. golangci/golangci-lint#3125
|
So the project is abandoned. |
Remove deprecated lints: golangci/golangci-lint#3125 Re-enable gocritic features which previously didn't support generics
* Update golangci-lint version to 1.50.1 Remove deprecated lints: golangci/golangci-lint#3125 Re-enable gocritic features which previously didn't support generics * gofmt * Pass PrevBackupInfo by reference as it is 232 bytes
* Bump reviewdog golangci-lint action major version This is a necessary precursor to bumping the Go version from 1.21 to 1.22, which will be done in separate PR. * Remove deprecated deadcode linter See golangci/golangci-lint#3125 * Add missing period at end of comment As warned by golangci-lint. * Remove unnecessary trailing whitespace As per golangci-lint warning. * Change case of variable to mixed not snake As per golangci-lint warning. * Fix cuddled statements warned by golangci-lint * Fix return with no blank line before lint warnings * Fix unchecked error return value linting warnings * Exclude line from line length linter warning * Format files with gofumpt to fix linting warnings * Exclude file permissions line from gosec linting The [gosec linter][1] warns by default on [file permissions above 0600][2]. We need the permissions to be 0644 for this line (because it has to be written to), so we exclude it from linting. [1]: https://github.com/securego/gosec [2]: securego/gosec#107 * Remove depguard from Go linting Created #430 to consider reinstating it in the future. * Fix magic number warning by extracting constant * Fix cuddling linter warnings * Add required comment to exported function * Do not use deprecated ioutil package * Remove unused function
also, remove them from the default linters.
They can be replaced by
unused
.varcheck
andstructcheck
have not changed for 3 years. https://github.com/opennota/check / https://gitlab.com/opennota/checkdeadcode
have not changed for 6 years. https://github.com/remyoudompheng/go-miscAll those linters are using the deprecated
golang.org/x/tools/go/loader
API that is deprecated for more than 3 years (this API does not have support for Go modules).https://github.com/golang/tools/blob/587a15310bddfc939d37cfaa8be8ea4c3808c3f1/go/loader/doc.go#L10-L11
Fixes #1841
issue related to
structcheck
:Close #1517
Close #826