Warn about unused linter settings #5644
-
I propose that Golangci-lint should raise a warning when it detects an unused linter settings. Consider the following configuration: version: "2"
linters:
default: none
enable:
# - rowserrcheck
- whitespace
settings:
rowserrcheck:
packages:
- github.com/jmoiron/sqlx When running golangci-lint, it should print something like:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I need to think about that, but this cannot be the default behavior because |
Beta Was this translation helpful? Give feedback.
-
To add some contrast I don't think I would want this. I can see myself sharing a base config and keeping that in sync across multiple projects but only changing the enable/disable list. Keeping such config in sync is harder if I have to remove sections to avoid warnings. Further i think sensible defaults for linters and having them easily sharable is a good thing. It would make it easier to tinker around with your preferred linter setup. As long as it doesn't affect the lint result I don't think it's |
Beta Was this translation helpful? Give feedback.
After thinking about that, I concluded that it isn't worth the cost.
The ratio between value and maintenance cost is extremely low.
Having unused settings is not a problem, it's more of an advantage.