nicklockwood / SwiftFormat

A command-line tool and Xcode Extension for formatting Swift code
MIT License
7.62k stars 623 forks source link

0.53.9 regression: `error: --report requires --reporter to be specified` #1703

Closed ksuther closed 1 month ago

ksuther commented 1 month ago

We're seeing this new error after updating to 0.53.9. Looks like this was introduced by 88f60807d00ec97ac297e86705a2f190ebcbc725.

Was this an intentional change for the way we're using it? Based on a quick reading of the commit it seems like it was trying to fix a different issue.

Invocation

swiftformat file.swift --config .swiftformat --output stdout --quiet

Output

error: --report requires --reporter to be specified.

Expected output

A formatted file

Workaround

Outputting a report to /dev/null works, but feels clunky.

--report /dev/null --reporter default
djmango commented 1 month ago

Confirmed as well, running:

swiftformat stdin --output stdout --stdinpath ${INPUT}

Returns: error: --report file must be specified when --output is stdout.

Implementing your workaround now, thanks.

nicklockwood commented 1 month ago

@ksuther this was not intentional, sorry - I'll get it fixed

nicklockwood commented 1 month ago

@ksuther @djmango this should be fixed in 0.53.10 - you'll also need to remove your workarounds before the next major release as --reporter default is now deprecated

ksuther commented 1 month ago

Fixed here, thank you!