Programmatically Invoke Intellij's formatter on any Java source file


Is there a programmatic way of formatting any java file using intellij?

for example, I am expecting to do something like

format codestyle.xml, where format is a script that takes an intellij code style configuration (xml) and formats as if invoking format code on these files inside of intellij IDE. thanks

Please sign in to leave a comment.