/
Code Formatting (Backend)

Code Formatting (Backend)

IntelliJ

  1. Install and activate this plugin. Activation can be found under File → Settings → Other Settings → google-java-format Settings. Make sure the “Enable google-java-format”-checkbox is enabled.

  2. In File → Manage IDE Settings → Import Settings import the settings.zip file from qa/intellij. Import the templates and the macro.

  3. In Settings → Editor → Code Style → Java -> gear wheel (icon) -> Import Scheme -> IntelliJ IDEA code style XML import taskana_formatter_intellij.xml from taskana/qa/intellij.

  4. In Settings → Keymap search for “save all” and bind ctrl+s to the macro, thus overriding the save key. The macro will automatically format the current file and save all files.

Currently we are evaluating if Settings → Tools → Actions on save is an alternative to the macro. Feel free to use either one. Set at least the actions “Reformat code”, “Optimize imports” and “Rearrange code”.

For other IDEs check out the official GitHub Repository

 

Related content

Setup Development Environment
Setup Development Environment
More like this
Enable TRACE Logging with Logging AspectJ
Enable TRACE Logging with Logging AspectJ
More like this
Building a release
Building a release
Read with this
Code Formatting (Frontend)
Code Formatting (Frontend)
More like this
Check out and build
Check out and build
Read with this
Checkstyle
Checkstyle
More like this