pinterest / ktlint

An anti-bikeshedding Kotlin linter with built-in formatter
https://pinterest.github.io/ktlint/
MIT License
6.06k stars 504 forks source link

Add support for formatting a specific violation in a piece of code containing multiple violations #2658

Closed paul-dingemans closed 1 month ago

paul-dingemans commented 1 month ago

The Ktlint formatting fixes all violations in a given piece of code for which an autocorrect is available. Given a piece of code that contains multiple violations that can be autocorrected, it is not easily possible to indicate that only one specific violations needs to be fixed.

When the ktlint-intellij-plugin is used in manual the user wants/needs to resolve the violations one by one in order to pick and choose which violations have to be corrected. See https://github.com/nbadal/ktlint-intellij-plugin/issues/482