Skip to content

Commit

Permalink
Add precommit hook definition to perform basic formatting using spotl…
Browse files Browse the repository at this point in the history
…ess on indexer plugins
  • Loading branch information
QU3B1M committed Oct 15, 2024
1 parent 1a5fe23 commit b5ff4fe
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions plugins/command-manager/gradle/formatting.gradle
Original file line number Diff line number Diff line change
@@ -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'
}
}
14 changes: 14 additions & 0 deletions plugins/setup/gradle/formatting.gradle
Original file line number Diff line number Diff line change
@@ -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'
}
}

0 comments on commit b5ff4fe

Please sign in to comment.