The google-java-format plugin is the preferred way to format the code. As it only kicks in on demand, it’s also recommended to have code style settings which help to create properly formatted code as-you-go. Those settings can’t completely mimic the format enforced by the google-java-format plugin but try to be as close as possible. So before submitting code, please make sure to run Reformat Code.
- Download intellij-java-google-style.xml.
- Open Intellij
- Go to File → Settings → Editor → Code Style.
- Click on Manage.
- Click on Import.
- Choose IntelliJ IDEA Code Style XML.
- Select the previously downloaded file intellij-java-google-style.xml.
- Make sure that Google Style is chosen as Scheme.