diff --git a/plugins/command-manager/gradle/formatting.gradle b/plugins/command-manager/gradle/formatting.gradle new file mode 100644 index 0000000..036ac4a --- /dev/null +++ b/plugins/command-manager/gradle/formatting.gradle @@ -0,0 +1,14 @@ +import org.opensearch.gradle.BuildPlugin + +allprojects { + plugins.withType(BuildPlugin).whenPluginAdded { + project.apply plugin: "com.diffplug.spotless" + + spotless { + target 'src/**/*.java' + removeUnusedImports() + trimTrailingWhitespace() + } + precommit.dependsOn 'spotlessJavaCheck' + } +} diff --git a/plugins/setup/gradle/formatting.gradle b/plugins/setup/gradle/formatting.gradle new file mode 100644 index 0000000..036ac4a --- /dev/null +++ b/plugins/setup/gradle/formatting.gradle @@ -0,0 +1,14 @@ +import org.opensearch.gradle.BuildPlugin + +allprojects { + plugins.withType(BuildPlugin).whenPluginAdded { + project.apply plugin: "com.diffplug.spotless" + + spotless { + target 'src/**/*.java' + removeUnusedImports() + trimTrailingWhitespace() + } + precommit.dependsOn 'spotlessJavaCheck' + } +}