Skip to content

Commit c890b89

Browse files
committed
Add a CHANGES entry. Log only if totalProcessed>0
1 parent 8fcce07 commit c890b89

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

plugin-maven/CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
44

55
## [Unreleased]
66
### Added
7+
* A synthesis log with the number of considered files is added after each formatter execution [#1507](https://github.com/diffplug/spotless/pull/1507)
78
### Fixed
89
* The default list of type annotations used by `formatAnnotations` has had 8 more annotations from the Checker Framework added [#1494](https://github.com/diffplug/spotless/pull/1494)
910
### Changes

plugin-maven/src/main/java/com/diffplug/spotless/maven/SpotlessApplyMojo.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ protected void process(Iterable<File> files, Formatter formatter, UpToDateChecke
6666
int checkedButAlreadyClean = impactedFilesTracker.getCheckedButAlreadyClean();
6767
int cleaned = impactedFilesTracker.getCleaned();
6868
int totalProcessed = skippedAsCleanCache + checkedButAlreadyClean + cleaned;
69-
getLog().info(String.format("Spotless.%s is keeping %s files clean - %s were changed to be clean, %s were already clean, %s were skipped because caching determined they were already clean",
70-
formatter.getName(), totalProcessed, cleaned, checkedButAlreadyClean, skippedAsCleanCache));
69+
if (totalProcessed > 0) {
70+
getLog().info(String.format("Spotless.%s is keeping %s files clean - %s were changed to be clean, %s were already clean, %s were skipped because caching determined they were already clean",
71+
formatter.getName(), totalProcessed, cleaned, checkedButAlreadyClean, skippedAsCleanCache));
72+
}
7173
}
7274
}

0 commit comments

Comments
 (0)