Skip to content

Applied new paddedCell to gradle formatting. #108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -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}"
Expand Down
3 changes: 2 additions & 1 deletion gradle/java-publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ model {
username = cred('nexus_user')
password = cred('nexus_pass')
}
}}
}
}
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion plugin-gradle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
...
Expand All @@ -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')
Expand Down
6 changes: 3 additions & 3 deletions spotlessSelf.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
buildscript { repositories { jcenter() }}
buildscript { repositories { jcenter() } }

// applied by SelfTest
plugins {
Expand Down Expand Up @@ -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 {
Expand Down