FINERACT-1006 Added spotless to auto format source code
This commit is contained in:
committed by
Michael Vorburger ⛑️
parent
64628345a0
commit
89e321acaf
@@ -48,6 +48,7 @@ buildscript {
|
||||
classpath "gradle.plugin.com.github.andygoossens:gradle-modernizer-plugin:1.3.0"
|
||||
classpath "gradle.plugin.com.gorylenko.gradle-git-properties:gradle-git-properties:2.2.2"
|
||||
classpath "net.ltgt.gradle:gradle-errorprone-plugin:1.2.1"
|
||||
classpath "com.diffplug.spotless:spotless-plugin-gradle:4.1.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,6 +70,7 @@ apply plugin: 'com.github.andygoossens.gradle-modernizer-plugin'
|
||||
apply plugin: 'jacoco'
|
||||
apply plugin: "com.gorylenko.gradle-git-properties"
|
||||
apply plugin: "net.ltgt.errorprone"
|
||||
apply plugin: "com.diffplug.gradle.spotless"
|
||||
// apply plugin: 'pmd'
|
||||
|
||||
dependencyManagement {
|
||||
@@ -193,6 +195,26 @@ jacocoTestReport{
|
||||
}
|
||||
}
|
||||
|
||||
spotless {
|
||||
format 'misc', {
|
||||
target '**/*.md', '**/*.properties', '**/*.gradle', '**/.gitignore', '**/*.yml', '**/*.xml', '**/**.json', '**/*.sql'
|
||||
targetExclude '**/build/**', '**/bin/**'
|
||||
indentWithSpaces(4)
|
||||
endWithNewline()
|
||||
trimTrailingWhitespace()
|
||||
}
|
||||
|
||||
java {
|
||||
importOrder() //sort imports alphabetically
|
||||
removeUnusedImports()
|
||||
eclipse().configFile '../config/fineractdev-formatter.xml'
|
||||
endWithNewline()
|
||||
trimTrailingWhitespace()
|
||||
}
|
||||
|
||||
lineEndings 'UNIX'
|
||||
}
|
||||
|
||||
rat {
|
||||
verbose = false
|
||||
reportDir = new File(buildDir,'reports/rat')
|
||||
@@ -458,6 +480,7 @@ modernizer {
|
||||
|
||||
compileJava{
|
||||
dependsOn rat
|
||||
dependsOn spotlessCheck
|
||||
}
|
||||
/*
|
||||
pmd {
|
||||
|
||||
Reference in New Issue
Block a user