Skip to content

Commit c57c381

Browse files
committed
State ./gradlew spotlessApply fixes all issues in error message
1 parent 892fd96 commit c57c381

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

plugin-gradle/CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
99
* Adds support for worktrees (fixes [#1765](https://github.com/diffplug/spotless/issues/1765))
1010
* Bump default `google-java-format` version to latest `1.24.0` -> `1.28.0`. ([#2345](https://github.com/diffplug/spotless/pull/2345))
1111
* Bump default `ktlint` version to latest `1.5.0` -> `1.7.1`. ([#2555](https://github.com/diffplug/spotless/pull/2555))
12+
* Running `spotlessCheck` with violations unilaterally produces the error message `Run './gradlew spotlessApply' to fix these violations`. ([#2592](https://github.com/diffplug/spotless/issues/2592))
1213
### Fixed
1314
* Respect system gitconfig when performing git operations ([#2404](https://github.com/diffplug/spotless/issues/2404))
1415

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,7 @@ void init(SpotlessTaskImpl impl) {
138138
getProjectPath().set(getProject().getPath());
139139
getEncoding().set(impl.getEncoding());
140140
getRunToFixMessage().convention(
141-
"Run '" + calculateGradleCommand() + " " + getTaskPathPrefix() + "spotlessApply' to fix these violations.");
142-
}
143-
144-
private String getTaskPathPrefix() {
145-
String path = getProjectPath().get();
146-
return path.equals(":") ? ":" : path + ":";
141+
"Run '" + calculateGradleCommand() + " spotlessApply' to fix all violations.");
147142
}
148143

149144
private static String calculateGradleCommand() {

0 commit comments

Comments
 (0)