From e7e60aabefc672d270500181f26cba853e025a25 Mon Sep 17 00:00:00 2001 From: Frank Vennemeyer Date: Thu, 4 May 2017 08:16:27 +0200 Subject: [PATCH] Applied new paddedCell to gradle formatting. Added corresponding comment to documentation. --- build.gradle | 2 +- gradle/java-publish.gradle | 3 ++- plugin-gradle/README.md | 4 +++- spotlessSelf.gradle | 6 +++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 4a36eaea71..b4c6ac9a66 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ buildscript { - repositories { maven { url 'https://plugins.gradle.org/m2/' }} + repositories { maven { url 'https://plugins.gradle.org/m2/' } } dependencies { classpath "com.diffplug.gradle:goomph:${VER_GOOMPH}" classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:${VER_BINTRAY}" diff --git a/gradle/java-publish.gradle b/gradle/java-publish.gradle index affc2da74e..bd98439492 100644 --- a/gradle/java-publish.gradle +++ b/gradle/java-publish.gradle @@ -117,7 +117,8 @@ model { username = cred('nexus_user') password = cred('nexus_pass') } - }} + } + } } } } diff --git a/plugin-gradle/README.md b/plugin-gradle/README.md index 9004b5baf9..80bb2ffedf 100644 --- a/plugin-gradle/README.md +++ b/plugin-gradle/README.md @@ -142,6 +142,8 @@ Configuration for Groovy is similar to [Java](#java). Most java steps, like `li The groovy formatter's default behavior is to format all `.groovy` and `.java` files found in the Groovy source directories. If you would like to exclude the `.java` files, set the parameter `excludeJava`, or you can set the `target` parameter as described in the [Custom rules](#custom) section. +Due to cyclic ambiguities of groovy formatter results, e.g. for nested closures, the use of [paddedCell()](../PADDEDCELL.md) and/or [Custom rules](#custom) is recommended to bandaid over this third-party formatter problem. + ```gradle apply plugin: 'groovy' ... @@ -154,7 +156,7 @@ spotless { groovy { licenseHeaderFile 'spotless.license.java' excludeJava() // excludes all Java sources within the Groovy source dirs from formatting - + paddedCell() // Avoid cyclic ambiguities // the Groovy Eclipse formatter extends the Java Eclipse formatter, // so it formats Java files by default (unless `excludeJava` is used). greclipse().configFile('greclipse.properties') diff --git a/spotlessSelf.gradle b/spotlessSelf.gradle index 81b45d9403..bed0662ed6 100644 --- a/spotlessSelf.gradle +++ b/spotlessSelf.gradle @@ -1,4 +1,4 @@ -buildscript { repositories { jcenter() }} +buildscript { repositories { jcenter() } } // applied by SelfTest plugins { @@ -32,9 +32,9 @@ spotless { include '**/*.gradle' exclude '_ext/**' } + paddedCell() custom 'noInternalDeps', noInternalDepsClosure - custom 'preventFormatPingPong', { return it.replaceAll('}[ \t]+}', '}}') } - bumpThisNumberIfACustomStepChanges(1) + bumpThisNumberIfACustomStepChanges(3) greclipse().configFile('spotless.eclipseformat.xml', 'spotless.groovyformat.prefs') } freshmark {