You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
detekt runs ktlint rules in the order that ktlint expects.
Observed Behavior
ktlint has a few different visitor modifiers that add constraints to the order rules are run in.
detekt checks and respects RunAsLateAsPossible and RunOnRootNodeOnly constraints, but does not check RunAfterRule. This can affect results when using autocorrect and individual rules aren't run in the correct order.
Interesting…
I remember a few bug reports regarding auto-correct. It’s good that we finally discovered the reason for it.
Do you have any ideas how we can fix it in detekt?
Expected Behavior
detekt runs ktlint rules in the order that ktlint expects.
Observed Behavior
ktlint has a few different visitor modifiers that add constraints to the order rules are run in.
detekt checks and respects
RunAsLateAsPossible
andRunOnRootNodeOnly
constraints, but does not checkRunAfterRule
. This can affect results when using autocorrect and individual rules aren't run in the correct order.See https://github.com/pinterest/ktlint/blob/0.46.1/ktlint-core/src/main/kotlin/com/pinterest/ktlint/core/Rule.kt#L39-L60
Steps to Reproduce
I don't have a reproducer, but discovered this when doing some other work on the formatting rule set.
Context
Can affect autocorrect.
Your Environment
--scan
option when running the gradle task):The text was updated successfully, but these errors were encountered: