Skip to content
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

Merged
merged 6 commits into from
Mar 3, 2024

Conversation

ldez
Copy link
Member

@ldez ldez commented Mar 2, 2024

The currently deprecated linters have been deprecated for a long time and a lot of then received their last commit in 2018-2019.

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:

  • replace deprecated linters with Noop
  • remove code related to deprecated linters
  • clean reference file
  • remove linter settings

None of the changes are breaking.

With this PR all the deprecated dependencies, of those linters, are removed 🎉.

Related to #1987

@ldez ldez added the linter: update Update the linter implementation inside golangci-lint label Mar 2, 2024
@ldez ldez requested review from bombsimon and Antonboom March 2, 2024 20:52
@ldez ldez added the topic: cleanup Related to code, process, or doc cleanup label Mar 2, 2024
.golangci.reference.yml Show resolved Hide resolved
Copy link
Member

@bombsimon bombsimon left a 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?

@ldez
Copy link
Member Author

ldez commented Mar 3, 2024

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 👍

@ldez ldez force-pushed the fix/noop-deprecated-linters branch from 800d7ca to f3d0213 Compare March 3, 2024 16:07
@ldez ldez changed the title fix: replace deprecated linters by Noop fix: inactivate deprecated linters Mar 3, 2024
@ldez ldez changed the title fix: inactivate deprecated linters feat: inactivate deprecated linters Mar 3, 2024
@ldez ldez merged commit a087808 into golangci:master Mar 3, 2024
12 checks passed
@ldez ldez deleted the fix/noop-deprecated-linters branch March 3, 2024 19:40
@ldez ldez added this to the next milestone Mar 4, 2024
nirs added a commit to nirs/cobra that referenced this pull request May 18, 2024
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/
marckhouzam pushed a commit to spf13/cobra that referenced this pull request May 19, 2024
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linter: update Update the linter implementation inside golangci-lint topic: cleanup Related to code, process, or doc cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants