FINERACT-1188: README and other files are not covered by Spotless
This commit is contained in:
committed by
Petri Tuomola
parent
8c342a7d88
commit
5520bb3c2d
+112
@@ -16,8 +16,120 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
// TODO: this is work in progress, please follow FINERACT-1171
|
||||
buildscript {
|
||||
ext {
|
||||
jacocoVersion = '0.8.5'
|
||||
}
|
||||
repositories {
|
||||
jcenter()
|
||||
maven { url "https://plugins.gradle.org/m2/" }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.bmuschko:gradle-cargo-plugin:2.7.1'
|
||||
classpath 'org.zeroturnaround:gradle-jrebel-plugin:1.1.10'
|
||||
classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.3.4.RELEASE'
|
||||
classpath 'gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.15.0'
|
||||
classpath 'org.apache.openjpa:openjpa:3.1.2' // when upgrading, also change OpenJPA version repeated in fineract-provider/build.gradle!
|
||||
classpath 'com.radcortez.gradle:openjpa-gradle-plugin:3.1.0'
|
||||
classpath 'org.nosphere.apache:creadur-rat-gradle:0.7.0'
|
||||
classpath "gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.5.1"
|
||||
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.3"
|
||||
classpath "net.ltgt.gradle:gradle-errorprone-plugin:1.2.1"
|
||||
classpath "io.swagger.core.v3:swagger-gradle-plugin:2.1.5"
|
||||
classpath "gradle.plugin.org.hidetake:gradle-swagger-generator-plugin:2.18.2"
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'io.spring.dependency-management' version '1.0.10.RELEASE'
|
||||
id 'com.diffplug.spotless' version '5.6.1'
|
||||
}
|
||||
|
||||
description = '''\
|
||||
Run as:
|
||||
gradle clean bootRun'''
|
||||
|
||||
project.ext.jerseyVersion = '1.19.4'
|
||||
ext['groovy.version'] = '3.0.6'
|
||||
|
||||
allprojects {
|
||||
group = 'org.apache.fineract'
|
||||
|
||||
repositories {
|
||||
jcenter()
|
||||
}
|
||||
|
||||
apply plugin: 'io.spring.dependency-management'
|
||||
apply plugin: "com.diffplug.spotless"
|
||||
|
||||
// Configuration for the spotless plugin
|
||||
// https://github.com/diffplug/spotless/tree/main/plugin-gradle
|
||||
spotless {
|
||||
format 'misc', {
|
||||
target '**/*.md', '**/*.properties', '**/.gitignore', '**/*.yml', '**/*.xml', '**/**.json', '**/*.sql'
|
||||
targetExclude '**/build/**', '**/bin/**', '**/.settings/**', '**/.idea/**', '**/.gradle/**'
|
||||
indentWithSpaces(4)
|
||||
endWithNewline()
|
||||
trimTrailingWhitespace()
|
||||
}
|
||||
|
||||
groovyGradle {
|
||||
target '*.gradle', '**/*.gradle'
|
||||
targetExclude '**/build/**'
|
||||
greclipse()
|
||||
indentWithSpaces(4)
|
||||
endWithNewline()
|
||||
trimTrailingWhitespace()
|
||||
}
|
||||
|
||||
if (plugins.hasPlugin('java')) {
|
||||
java {
|
||||
targetExclude '**/build/**', '**/bin/**', '**/out/**'
|
||||
importOrder() //sort imports alphabetically
|
||||
removeUnusedImports()
|
||||
eclipse().configFile "$rootDir/config/fineractdev-formatter.xml"
|
||||
endWithNewline()
|
||||
trimTrailingWhitespace()
|
||||
|
||||
// Enforce style modifier order
|
||||
custom 'Modifier ordering', {
|
||||
def modifierRanking = [
|
||||
public : 1,
|
||||
protected : 2,
|
||||
private : 3,
|
||||
abstract : 4,
|
||||
default : 5,
|
||||
static : 6,
|
||||
final : 7,
|
||||
transient : 8,
|
||||
volatile : 9,
|
||||
synchronized: 10,
|
||||
native : 11,
|
||||
strictfp : 12]
|
||||
// Find any instance of multiple modifiers. Lead with a non-word character to avoid
|
||||
// accidental matching against for instance, "an alternative default value"
|
||||
it.replaceAll(/\W(?:public |protected |private |abstract |default |static |final |transient |volatile |synchronized |native |strictfp ){2,}/, {
|
||||
// Do not replace the leading non-word character. Identify the modifiers
|
||||
it.replaceAll(/(?:public |protected |private |abstract |default |static |final |transient |volatile |synchronized |native |strictfp ){2,}/, {
|
||||
// Sort the modifiers according to the ranking above
|
||||
it.split().sort({ modifierRanking[it] }).join(' ') + ' '
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (project.hasProperty("automatedBuild")) {
|
||||
dependsOn(spotlessCheck)
|
||||
} else {
|
||||
dependsOn(spotlessApply)
|
||||
}
|
||||
}
|
||||
|
||||
lineEndings 'UNIX'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user