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(configuration): add the fix rule option #2892

Merged
merged 2 commits into from
May 16, 2024
Merged

Conversation

Conaclos
Copy link
Member

Summary

Fix #2882

To reuse FixKind, I had to add a new variant FixKind::None.
We now use FixKind::None for all rules without code action.

The configured fix kind of a rule is passed to the analyzer in the same way as we pass rule options.
If it is not set, then we use the default fix kind/applicability of the rule.
Otherwise, we use the configured fix kind to set the applicability of an action.
When the fix kind is configured to FixKindNone, we prevent calling the rule action method.

Test Plan

I added new tests.

@github-actions github-actions bot added A-CLI Area: CLI A-Project Area: project A-Linter Area: linter L-JavaScript Language: JavaScript and super languages A-Changelog Area: changelog labels May 16, 2024
@Conaclos Conaclos requested review from a team May 16, 2024 16:27
Copy link

codspeed-hq bot commented May 16, 2024

CodSpeed Performance Report

Merging #2892 will not alter performance

Comparing conaclos/rule-fix-option (57ad88c) with main (d215034)

Summary

✅ 99 untouched benchmarks

@Conaclos Conaclos merged commit 6a4c79e into main May 16, 2024
15 checks passed
@Conaclos Conaclos deleted the conaclos/rule-fix-option branch May 16, 2024 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-CLI Area: CLI A-Linter Area: linter A-Project Area: project L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

📎 Make code fix kind configurable
2 participants