From ff4c52ec381dd5dd9cef47e5e5723abfd07840f3 Mon Sep 17 00:00:00 2001 From: Mitchell Gale Date: Mon, 21 Aug 2023 11:12:30 -0700 Subject: [PATCH] addressed PR comments Signed-off-by: Mitchell Gale --- DEVELOPER_GUIDE.rst | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/DEVELOPER_GUIDE.rst b/DEVELOPER_GUIDE.rst index 64661e92df..4c8bf36a18 100644 --- a/DEVELOPER_GUIDE.rst +++ b/DEVELOPER_GUIDE.rst @@ -185,6 +185,19 @@ Note that other related project code has already merged into this single reposit Code Convention --------------- +Java files in the OpenSearch codebase are formatted with the Eclipse JDT formatter, using the [Spotless Gradle](https://github.com/diffplug/spotless/tree/master/plugin-gradle) plugin. This plugin is configured in the project `./gradle.properties`. + +The formatting check can be run explicitly with: +./gradlew spotlessJavaCheck + +The code can be formatted with: +./gradlew spotlessApply + +These tasks can also be run for specific modules, e.g. +./gradlew server:spotlessJavaCheck + +For more information on the spotless for the OpenSearch project please see `https://github.com/opensearch-project/OpenSearch/blob/main/DEVELOPER_GUIDE.md#java-language-formatting-guidelines`_. + Java files are formatted using `Spotless `_ conforming to `Google Java Format `_. * - New line at end of file * - No unused import statements @@ -195,13 +208,6 @@ Java files are formatted using `Spotless ` * - Javadoc format can be maintained by wrapping javadoc with `
` HTML tags
    * - Strings can be formatted on multiple lines with a `+` with the correct indentation for the string.
 
-Spotless changes required can be run with:
-`./gradlew spotlessJavaCheck`
-Recommended changes can be applied automatically with:
-`./gradlew spotlessApply`
-
-For more information on Spotless in the OpenSearch-project, please refer to the opensearch-project `developers_guide.md `_. Note, there are differences in the exact formatting rules applied by spotless.
-
 Building and Running Tests
 ==========================