Click the cogwheel to the right of “Scheme”, and select Import Scheme > IntelliJ IDEA code style XML.ġ0. Go to File > Settings > Editor > Code Style > Java.ĩ. Make sure “Only Java sources (including tests)” is selected for “Scan Scope” (top right).Ĩ. “ONAP Checks”) and browse for the saved onap_checkstyle_configuration.xml.Ħ. Add a new Configuration File (green plus sign on the right).ĥ. Go to File > Settings > Other Settings > Checkstyle.Ĥ. Save the attached onap_checkstyle_configuration.xml and onap_intellij_java_formatting.xml on your local disk.ģ. Thoroughly reviewed IntelliJ code formatting configuration for Java – aligned with the ONAP requirements as much as possible. IntelliJ Checkstyle plugin coupled with a modified version of Checkstyle configuration for Google Style, which was made to comply with the ONAP requirements. 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. 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |