diff --git a/CHANGES.md b/CHANGES.md index 171bfe169d..425bbe1821 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,6 +7,12 @@ You might be looking for: ### Version 1.2.0-SNAPSHOT - TBD (javadoc [lib](https://diffplug.github.io/spotless/javadoc/spotless-lib/snapshot/) [lib-extra](https://diffplug.github.io/spotless/javadoc/spotless-lib-extra/snapshot/), [snapshot repo](https://oss.sonatype.org/content/repositories/snapshots/com/diffplug/spotless/)) +* Deprecated `FileSignature.from` in favor of `FileSignature.signAsSet` and the new `FileSignature.signAsList`. +* Added a `FormatterProperties` class which loads `.properties` files and eclipse-style `.xml` files. +* `SerializableFileFilter.skipFilesNamed` can now skip multiple file names. +* Update default KtLint from 0.3.1 to 0.6.1. + + This means we no longer look for rules in the typo package `com.gihub.shyiko`, now only in `com.github.shyiko` (note the `t`). + ### Version 1.1.0 - February 27th 2017 (javadoc [lib](https://diffplug.github.io/spotless/javadoc/spotless-lib/1.1.0/) [lib-extra](https://diffplug.github.io/spotless/javadoc/spotless-lib-extra/1.1.0/), artifact [lib]([jcenter](https://bintray.com/diffplug/opensource/spotless-lib), [lib-extra]([jcenter](https://bintray.com/diffplug/opensource/spotless-lib-extra))) * Added support for Scala via [scalafmt](https://github.com/olafurpg/scalafmt). diff --git a/plugin-gradle/CHANGES.md b/plugin-gradle/CHANGES.md index 575853f08d..41953db8d9 100644 --- a/plugin-gradle/CHANGES.md +++ b/plugin-gradle/CHANGES.md @@ -2,6 +2,12 @@ ### Version 3.2.0-SNAPSHOT - TBD ([javadoc](https://diffplug.github.io/spotless/javadoc/snapshot/), [snapshot](https://oss.sonatype.org/content/repositories/snapshots/com/diffplug/spotless/spotless-plugin-gradle/)) +* Update default KtLint from 0.3.1 to 0.6.1 (thanks to @kvnxiao [#93](https://github.com/diffplug/spotless/pull/93)). + + This means we no longer look for rules in the typo package `com.gihub.shyiko`, now only in `com.github.shyiko` (note the `t`). +* Added an `enforceCheck` property which allows users to disable adding `spotlessCheck` as a dependency of `check` (thanks to @gdecaso [#95](https://github.com/diffplug/spotless/pull/95)). +* Any errors in a step will now fail the build - previously they were only warned. + + We claimed that we implemented this in 3.1.0, but it was broken. We really fixed it this time. + ### Version 3.1.0 - February 27th 2017 ([javadoc](https://diffplug.github.io/spotless/javadoc/spotless-plugin-gradle/3.1.0/), [jcenter](https://bintray.com/diffplug/opensource/spotless-plugin-gradle/3.1.0)) * Added support for Scala via [scalafmt](https://github.com/olafurpg/scalafmt). diff --git a/plugin-gradle/README.md b/plugin-gradle/README.md index c36d2a605c..271878f805 100644 --- a/plugin-gradle/README.md +++ b/plugin-gradle/README.md @@ -236,6 +236,34 @@ Line endings can also be set globally or per-format using the `lineEndings` prop You can easily set the line endings of different files using [a `.gitattributes` file](https://help.github.com/articles/dealing-with-line-endings/). Here's an example `.gitattributes` which sets all files to unix newlines: `* text eol=lf`. +## Disabling warnings and error messages + +The `check` task is Gradle's built-in task for grouping all verification tasks - unit tests, static analysis, etc. By default, `spotlessCheck` is added as a dependency to `check`. + +You might want to disable this behavior. We [recommend against this](https://github.com/diffplug/spotless/issues/79#issuecomment-290844602), but it's easy to do if you'd like: + +```gradle +spotless { + enforceCheck false +} +``` + +If a formatter throws an exception, possibly because of malformed code or a bug in a formatter step, Spotless will report a build failure. You can suppress these specific failures as such: + +```gradle +spotless { + java { + googleJavaFormat() + custom 'my-glitchy-step', { } + + ignoreErrorForStep('my-glitchy-step') // ignore errors on all files thrown by a specific step + ignoreErrorForPath('path/to/file.java') // ignore errors by all steps on this specific file + } +} +``` + +Note that `enforceCheck` is a global property which affects all formats (outside the java block), while `ignoreErrorForStep/Path` are local to a single format (inside the java block). + ## How do I preview what `spotlessApply` will do? - Save your working tree with `git add -A`, then `git commit -m "Checkpoint before spotless."`