Hey everyone,
So we’ve been establishing infrastructure and conventions and I’ve been working on OLMIS-722, which adds checkstyle to the service template and the example and requisition services. From this, it has been decided we are going to follow
Google
Java coding style conventions.
In this story, I have added the Gradle checkstyle plugin and configured it to check Java and test Java classes for checkstyle issues. This gradle task ‘
check’ is built into the ‘
build' task. The
checkstyle
configuration XML was copied into the local repository.
Please try to fix any checkstyle warnings that result from development. If you are using IntelliJ, you can make it easier with some configuration below.
To have IntelliJ flag some checkstyle warnings, install the Checkstyle-IDEA plugin and enable it (under Plugins). Then for each project, configure Checkstyle (under Other Settings) by adding the checkstyle.xml in the project folder. Enable the
checkbox, enable the “Scan test classes” checkbox as well and save.
To help with whitespace, imports and column limits, you can get the IntelliJ Google Java XML, and import it (under Editor -> Code Style -> Java). The
official
XML is found online—however, it is old and does not actually match the most recent version of the guide. Attached is a modified version that fits the coding style guide better. Once it is imported, you can reformat code and optimize imports under the Code
menu.
Please let me know if there’s any feedback or questions.