Skip to content

dev: simplify linter constructors #5796

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

Merged
merged 1 commit into from
May 13, 2025

Conversation

ldez
Copy link
Member

@ldez ldez commented May 13, 2025

90% of linters use only one analyzer, so a Linter constructor that takes only one analyzer can be used.

Also, the configuration map for those linters always uses the name of the analyzer as the first and only key, then, a method WithConfig, that handles this key, can be used.

This simplifies and removes a lot of code.

@ldez ldez added this to the v2-unreleased milestone May 13, 2025
@ldez ldez requested a review from bombsimon May 13, 2025 11:05
@ldez ldez added the topic: cleanup Related to code, process, or doc cleanup label May 13, 2025
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.

LGTM!

@ldez ldez merged commit aec176a into golangci:main May 13, 2025
18 checks passed
@ldez ldez deleted the feat/new-linter-constructor branch May 13, 2025 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: cleanup Related to code, process, or doc cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants