Only format changed files (#1217)

This commit is contained in:
Simon Rüegg
2025-09-19 15:16:32 +02:00
committed by GitHub
parent f327c8e086
commit d1171db3d5

View File

@@ -35,8 +35,8 @@ class CliFormatterApply(
val contents = Files.readString(path)
val (formatted, stat) = format(path, contents)
status = if (status == 0) stat else status
if (stat != 0) continue
if (!silent && contents != formatted) {
if (stat != 0 || contents == formatted) continue
if (!silent) {
consoleWriter.write(path.toAbsolutePath().toString())
consoleWriter.appendLine()
consoleWriter.flush()