nbadal / ktlint-intellij-plugin

Ktlint plugin for IntelliJ IDEA + Android Studio
MIT License
158 stars 24 forks source link

Version 23.0 does not respect the Disabled setting in the KtLint settings #536

Closed ctdavids closed 3 months ago

ctdavids commented 3 months ago

With the plugin disabled (at the Intellij disabling plugin level) and default IntelliJ formatting this code is not adjusted when you run IntelliJ autoformatting:

data class Hiya(val foo: String)

With the plugin enabled (at IntelliJ level), but configured as disabled under the KtLint setting, the code IS reformatted as:

data class Hiya(
    val foo: String,
)

The plugin DOES seem to respect not running on save when in disabled mode.

In order to get the plugin the stop reformatting things while in Disabled mode you have to first change it to Manual mode and uncheck the "attach to IntelliJ IDEA formatting" option (an option which is not visible in Disabled mode).

paul-dingemans commented 3 months ago

Good find! Tnx for reporting the reproduction path which was very helpful in solving the issue. Solved in https://github.com/nbadal/ktlint-intellij-plugin/commit/c202e99b54d288098f3c9df3a574a0a38dd086ad. See latest version on https://plugins.jetbrains.com/plugin/15057-ktlint/versions/dev