detekt / detekt-intellij-plugin

detekt plugin for IntelliJ
https://plugins.jetbrains.com/plugin/10761-detekt
Apache License 2.0
299 stars 39 forks source link

Feature request: Auto Correct Kotlin file on "cmd+option+L" but perform traditional intellij based reformat for non-kotlin files #500

Open sachin-tripactions opened 12 months ago

sachin-tripactions commented 12 months ago

Currently I have been using a custom keymap to bind "cmd+option+L" for detekt auto correct. I can very well use another keymap for detekt auto correct. But what if we introduce a feature where "cmd+option+L" would work seamlessly for both kotlin and non-kotlin files? i.e "cmd+option+L" would:

  1. Detekt auto correct if it is kotlin file
  2. Or perform intellij based reformat if it is not kotlin file
arturbosch commented 11 months ago

Hm, I'm not sure if IntelliJ already supports running an action after save ? Seems like some preconfigured options from IntelliJ. I wonder if the api allows to register our actions to this menu:

Screenshot from 2023-12-19 23-44-26