-
Notifications
You must be signed in to change notification settings - Fork 39
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
KtLint: migrate from RuleSetProvider
to RuleSetProviderV2
#1543
Closed
6 of 7 tasks
Tracked by
#1561
Milestone
Comments
0x6675636b796f75676974687562
added
bug
Something isn't working
epic
Major feature, could be decomposed into smaller tasks
labels
Oct 31, 2022
A common suggestion:
@akuleshov7 @petertrr @0x6675636b796f75676974687562, what do you thing? |
Sounds like a good idea. Not only will it help us adapt to changes in RuleSetProvider-related APIs (e.g. ordering) but will also decouple diktat from ktlint a bit and maybe even let us try Detekt as a framework |
0x6675636b796f75676974687562
added a commit
that referenced
this issue
Nov 18, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
KtLint has introduced a major API change in the 0.47 release (see the Release Notes).
In particular,
RuleSet
andRuleSetProvider
interfaces have been marked as deprecated, scheduled for removal in 0.48.We'll need to rewrite
DiktatRuleSetProvider
andOrderedRuleSet
implementations accordingly.RuleExecutionException
(orKtLintRuleExecutionException
) a part of the public API pinterest/ktlint#1710com.pinterest.ktlint.core.Rule
org.cqfn.diktat.ruleset.rules.DiktatRule
as isRuleProxy
for runningorg.cqfn.diktat.ruleset.rules.DiktatRule
ascom.pinterest.ktlint.core.Rule
DiktatRuleProxyFactory
which createscom.pinterest.ktlint.core.Rule
usingconfigRules
and createsvisitorModifiers
which are required for ordering.DiktatRuleSetProviderV2
andOrderedRuleSet
: Diktat's proxy toRuleSetProviderV2
should keep orderingRule.VisitorModifier
only when creatingRuleSetProviderV2
and it's only KtLint-specific. Preserve all logic related to creating KtLintRule
's in a single place.DiktatRuleSetProviderTest#check DiktatRuleSetProviderTest contain all rules
test which reads the source code ofRule
and/orDiktatRule
implementors to determine which rules are available at compile time.The text was updated successfully, but these errors were encountered: