mirror of
https://github.com/apple/pkl.git
synced 2026-03-23 01:29:20 +01:00
Change pkl format --write to exit 0 when formatting violations are found (#1340)
This commit is contained in:
@@ -110,7 +110,6 @@ constructor(
|
||||
|
||||
val formatted = format(contents)
|
||||
if (contents != formatted) {
|
||||
status.update(FORMATTING_VIOLATION)
|
||||
if (diffNameOnly || overwrite) {
|
||||
// if `--diff-name-only` or `-w` is specified, only write file names
|
||||
writeLine(pathStr)
|
||||
@@ -118,6 +117,9 @@ constructor(
|
||||
|
||||
if (overwrite) {
|
||||
path.writeText(formatted, Charsets.UTF_8)
|
||||
} else {
|
||||
// only exit on violation for "check" operations, not when overwriting
|
||||
status.update(FORMATTING_VIOLATION)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user