Skip to content

Commit e374870

Browse files
authored
Merge pull request #602 from diffplug/feat/deprecate-spotlessFiles
Deprecate -PspotlessFiles.
2 parents ca5f50d + 177122d commit e374870

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

plugin-gradle/CHANGES.md

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `3.27.0`).
44

55
## [Unreleased]
6+
### Deprecated
7+
* `-PspotlessFiles` has been deprecated and will be removed. It is slow and error-prone, especially for win/unix cross-platform, and we have better options available now:
8+
* If you are formatting just one file, try the much faster [IDE hook](https://github.com/diffplug/spotless/blob/master/plugin-gradle/IDE_HOOK.md)
9+
* If you are integrating with git, try the much easier (and faster) [`ratchetFrom 'origin/master'`](https://github.com/diffplug/spotless/tree/master/plugin-gradle#ratchet)
10+
* If neither of these work for you, let us know in [this PR](https://github.com/diffplug/spotless/pull/602).
611
### Added
712
* (spotless devs only) if you specify `-PspotlessModern=true` Spotless will run the in-progress Gradle `5.4+` code. The `modernTest` build task runs our test suite in this way. It will be weeks/months before this is recommended for end-users. ([#598](https://github.com/diffplug/spotless/pull/598))
813

plugin-gradle/src/main/java/com/diffplug/gradle/spotless/SpotlessExtension.java

+4
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ protected void createFormatTasks(String name, FormatExtension formatExtension) {
9292
project.afterEvaluate(unused -> {
9393
String filePatterns;
9494
if (project.hasProperty(FILES_PROPERTY) && project.property(FILES_PROPERTY) instanceof String) {
95+
System.err.println("Spotless with -P" + FILES_PROPERTY + " has been deprecated and will be removed. It is slow and error-prone, especially for win/unix cross-platform, and we have better options available now:");
96+
System.err.println(" If you are formatting just one file, try the much faster IDE hook: https://github.com/diffplug/spotless/blob/master/plugin-gradle/IDE_HOOK.md");
97+
System.err.println(" If you are integrating with git, try `ratchetFrom 'origin/master'`: https://github.com/diffplug/spotless/tree/master/plugin-gradle#ratchet");
98+
System.err.println(" If neither of these work for you, please let us know in this PR: https://github.com/diffplug/spotless/pull/602");
9599
filePatterns = (String) project.property(FILES_PROPERTY);
96100
} else {
97101
// needs to be non-null since it is an @Input property of the task

0 commit comments

Comments
 (0)