Search code examples
android-studiointellij-ideareformat

IntelliJ auto reformat code on run


I would like to execute the "reformat code" action on the entire project automatically when I press the run button. Is there any way to do this?


Solution

  • I see two possibilities:

    1. Configure action Run and Reformat code to the same keyboard shortcut

    2. Use reformat on save.

    P.S. In any project there must be a VCS. Working with it inside IDEA is really good and you should learn how to use it. There is a native reformat on commit checkbox in the commit dialog.