Skip to content

Conversation

nirs
Copy link
Contributor

@nirs nirs commented May 18, 2024

"interfaces", "maligned", and "golint" do not produce any report and cause golangci-lint to fail as we can see in the CI.

  • Remove "interfaces" and "maligned" linters that have no replacement.
  • Replace golint with stylecheck

nirs added 2 commits May 18, 2024 17:54
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
Copy link
Collaborator

Thanks for this @nirs and for being so quick to fix the problem.
I'm going to merge this right away to fix the build.

Below are the warnings we used to get and that have some recommendations (I can see those when using golangci-lint 1.55.0):

WARN 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.
WARN The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'.
WARN The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner.

For maligned we do use govet already so we're good.
For interfacer as you point out, there is not recommended replacement.
For golint, the warning mentions using revive.

I quickly tried revive and it flags a bunch of unused parameters to functions. Doesn't seem critical although it could prove useful in some situation. Either way, it is not important for this PR.

Thanks again!

@marckhouzam marckhouzam merged commit 8003b74 into spf13:main May 19, 2024
@marckhouzam marckhouzam added this to the 1.9.0 milestone May 19, 2024
@nirs nirs deleted the golangci-lint branch August 24, 2024 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants