Java code formatter intellij

broken image

IntelliJ Checkstyle plugin coupled with a modified version of Checkstyle configuration for Google Style, which was made to comply with the ONAP requirements.

broken image

The home-built solution consists of two tools: 1. Surprisingly, it also seems to contradict the Google Style Guide in some cases.  The Google Java Format plugin has the tab size and line length hard-coded, so that we had to fix and re-package it.  The IntelliJ formatting for Google Java Style is for an old version of IntelliJ, and affects also the formatting of other languages (Python, JavaScript, etc.), which we want to avoid. We have tried the tools often mentioned in various forums, including the ONAP Wiki page above. Unfortunately, a generic tool never covers all possible cases of a particular style (e.g.

broken image

The challenge is to find a tool that would take care of code formatting automatically. Link to onap code style: Java code style Challenges ONAP Java Code Style is based on Google Style with two modifications  Line length  Indentation size Popular code style and code conventions documents often give a justification for each particular formatting decision. There are lots of resources that explain why. A consistent formatting is good regardless of specific project.

broken image