From 30ccd2b8355b63d7813132350a0472f8370c810a Mon Sep 17 00:00:00 2001 From: Jeremy Landis Date: Tue, 4 Jun 2024 20:21:31 -0400 Subject: [PATCH] [ci] Comment on what unchanged is This logic seems flimsy. For now, just labeled it for what it is. I think though we need to add extra item to properly track caching changes if formatting failed to do anything. --- src/main/java/net/revelc/code/formatter/FormatterMojo.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/revelc/code/formatter/FormatterMojo.java b/src/main/java/net/revelc/code/formatter/FormatterMojo.java index d1d95e14..0ddabbbc 100644 --- a/src/main/java/net/revelc/code/formatter/FormatterMojo.java +++ b/src/main/java/net/revelc/code/formatter/FormatterMojo.java @@ -775,6 +775,7 @@ protected void doFormatFile(final File file, final ResultCollector rc, final Pro // Process the result type if (Result.SKIPPED.equals(result)) { + // Use unchanged count for files that either 'skipFormattingCache' or cache missed but flagged to skip formatting. rc.unchangedCount++; } else if (Result.SUCCESS.equals(result)) { rc.successCount++; @@ -1111,7 +1112,7 @@ static class ResultCollector { /** The skipped count is incremented for cached files that haven't changed since being cached. */ int skippedCount; - /** The unchanged count is incremented on cache misses when a file remains unchanged after formatting. */ + /** Use unchanged count for files that either 'skipFormattingCache' or cache missed but flagged to skip formatting. */ int unchangedCount; /** The read only count. */