The check failed on zero errors
The issue described that after gradle clean openApiGenerate spotlessApply a directory stays behind in build/spotless-clean, and the next spotlessCheck or build throws There were 0 lint error(s). getUncleanFiles skipped files that matched the disk, but SpotlessCheck still went into the lint branch and threw with an empty list.
An exception only for real lints
The lint branch now runs only when the list of lints is not empty. Otherwise the task finishes without an error, since the files in spotless-clean are stale copies of what is already on disk. A new test, checkPassesWhenCleanFileMatchesDisk, covers this case, and the change has an entry in CHANGES.md.