Closed
Description
Is your feature request related to a problem? Please describe.
Now, Some linters have been deprecated on golangci-lint.
Golangci-lint send out a warn message to users who are using deprecated linter, telling them that it is deprecated.
The number of deprecated linters is expected to increase in the future.
We need to discuss how to handle deprecated linter.
Describe the solution you'd like
- It will be deprecated for a while and then removed from golangci-lint?
- For users who want to use a deprecated linter for some reason, leave it deprecated and leave it in golangci instead of deleting it?
- Create new status like
deleted
, separate from deprecated? - (Other opinions are welcome)
Additional context
had a small discussion on #1986 about how to handle deprecated linter when the enable-all
is specified
- If enable-all automatically avoids deprecated linter, existing users will not be able to notice that the linter they were using through enable-all has been deprecated.
- But, from the point of view of new golangci-lint users, in order to avoid using deprecated linters, they need to use enable-all with many disable options.
- This concern may not be necessary if deprecated linters will be removed from Golangci-lint finally. (This is because users only need to disable the linter that has been recently deprecated and has not yet been removed from golangci.)
Activity
sanposhiho commentedon May 16, 2021
I support this idea I mentioned above.
Users who want to use a linter that has been removed for some reason can use the linter.
As for the specification of the deleted status linter, I am thinking of the following
enable-all
deprecated
.enable-deleted
.enable
option, saying "This linter has been deleted, if you still want to enable it, please use the enable-deleted option". This will make the user stop using it unless they have a strong will to do so.ldez commentedon May 16, 2021
A standard deprecation cycle is: available -> deprecated -> removed
The questions behind this cycle are:
During the deprecation phase, it possible to have several steps:
The last phase (remove) is breaking, it's expected and it must clear: when something is removed it must be removed.
About phase durations, for me, it's better to link this to a version (minor or major) instead of months or a time duration.
Now, the main question: do we want to drop an item in a minor version or in a major version?
sanposhiho commentedon May 17, 2021
Right. So, do you mean that we should erase it completely from the golangci-lint code instead of leaving it on code as
deleted
state?agree :D
I think we should remove deprecated linters in the major version according to Semantic Versioning 2.0.0.
knweiss commentedon Jan 7, 2022
May I also suggest that deprecated linters should be removed from the various
--presets
sets?Example:
As I did not configure an explicit list of linters (but rely on the presets instead) the set of enabled linters should IMHO be free of deprecated linters that cause such warnings.
Searching for
Deprecated
ingolangci-lint/pkg/lint/lintersdb/manager.go
shows several of these cases.yangyile1990 commentedon Oct 24, 2022
yangyile1990 commentedon Oct 24, 2022
ldez commentedon Mar 3, 2024
My proposal is still nearly the same:
Each step is a minor version, ex:
Currently, we consider linters changes (like options that are breaking) like non-breaking changes for golangci-lint itself.
But we have to provide clear information about those changes (changelog, logs, public communication, etc.).
I think the lifecycle I propose allows us to provide this information.
Note: currently the deprecated linters are removed from
presets
by default (since #3405).