-
-
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: inactivate deprecated linters #4436
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!
There will always be people disappointed with changes like this but the list of linters has grown a lot and reducing it by removing deprecated linters seems very reasonable and shouldn't require any major release change or any other justification than the fact that they're deprecated.
Would it make sense to put a reason to this so we still get the warning message saying that it no longer will be run at all since it's removed and in a future version remove it completely?
😄 I didn't see your answer before I commenting here but we all share the same idea 👍 |
800d7ca
to
f3d0213
Compare
Currently golangci-lint fails with these errors: ERRO [linters_context] golint: This linter is fully inactivated: it will not produce any reports. ERRO [linters_context] interfacer: This linter is fully inactivated: it will not produce any reports. ERRO [linters_context] maligned: This linter is fully inactivated: it will not produce any reports. I could not find any docs explaining what "fully inactivated" mean, but based this PR[1] it seems that these linters do nothing now. Removing the linters fixes this issue without changing linting, as they did not produce any report. Looking in the linters docs[2] I did not find a replacement for "interfacer" and "malinged" linters. "stylecheck" seems to be a replacement for "golint", but we need to fix the code to enable it. [1] golangci/golangci-lint#4436 [2] https://golangci-lint.run/usage/linters/
* Remove fully inactivated linters Currently golangci-lint fails with these errors: ERRO [linters_context] golint: This linter is fully inactivated: it will not produce any reports. ERRO [linters_context] interfacer: This linter is fully inactivated: it will not produce any reports. ERRO [linters_context] maligned: This linter is fully inactivated: it will not produce any reports. I could not find any docs explaining what "fully inactivated" mean, but based this PR[1] it seems that these linters do nothing now. Removing the linters fixes this issue without changing linting, as they did not produce any report. Looking in the linters docs[2] I did not find a replacement for "interfacer" and "malinged" linters. "stylecheck" seems to be a replacement for "golint", but we need to fix the code to enable it. [1] golangci/golangci-lint#4436 [2] https://golangci-lint.run/usage/linters/ * Add stylecheck linter, replacement for golint This revealed 2 capitalized error messages. https://golangci-lint.run/usage/linters/#stylecheck
The currently deprecated linters have been deprecated for a long time and a lot of then received their last commit in 2018-2019.
ifshort
ifshort: deprecate linter #3034 (2022)structcheck
,varcheck
feat: deprecate varcheck, deadcode, and structcheck #3125 (2022)deadcode
feat: deprecate varcheck, deadcode, and structcheck #3125 (2022)golint
Deprecate golint #1965 (2021)maligned
Deprecate maligned, add govetfieldalignment
as replacement #1765 (2021)exhaustivestruct
feat: addexhaustruct
linter #2667 (2022)nosnakecase
nosnakecase: deprecate linter #3065 (2022)interfacer
DeprecateInterfacer
linter #1755 (2021)scopelint
Deprecate 'scopelint' linter #1819 (2021)Some of them panic with go1.21 or go1.22. (ex: #4361)
I think it's time to remove them, but I don't want to be breaking.
I just replaced the real implementation with
Noop
.The linters and their configuration can still be "used" inside the configuration (ex: inside
disable
) and nothing will break.Each commit contains one change:
Noop
None of the changes are breaking.
With this PR all the deprecated dependencies, of those linters, are removed 🎉.
Related to #1987