Swiftformat: --dryrun option has no return value

Created on 3 Jul 2018  路  7Comments  路  Source: nicklockwood/SwiftFormat

PR #177 added support for --dryrun and returning a non-zero exit code if anything would be modified. PR #202 looked to use that by giving instructions on configuring Danger using the assumption that you'll get a non-zero exit code if anything is formatted. While I don't use Danger, I'm guessing these instructions are broken (with or without --dryrun) since it doesn't appear non-zero exit codes are returned anymore. Was this an intentional change?

I'd like to incorporate a check in our CI environment to make sure everything is properly formatted but don't want to rely on parsing output from swiftformat. If I added back a non-zero exit code when formatting is performed (or would be performed), would that PR be accepted?

Thanks for your work on this!

Most helpful comment

@michaelmcguire the --lint option has landed in version 0.33.13. Thanks!

All 7 comments

I found the commit where this was removed.

@michaelmcguire it doesn't make sense to me that a mode called "dryrun" would return an error in the event that the command completes successfully.

I think a better option might be to add a new mode called something like "--lint" which behaves the same as "--dryrun" but returns an error if any changes would have been applied.

Does that seem reasonable?

@nicklockwood That makes perfect sense to me. I'll get started on that.

Hey, I was just about to ask about this. What's the progress on it? @michaelmcguire

@heyitswither hope to open a PR tomorrow

@michaelmcguire the --lint option has landed in version 0.33.13. Thanks!

@nicklockwood Awesome! Happy to help!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AniHovhannisyanAni picture AniHovhannisyanAni  路  3Comments

shripada picture shripada  路  3Comments

sebastianfrelle picture sebastianfrelle  路  4Comments

zizi4n5 picture zizi4n5  路  3Comments

igorkulman picture igorkulman  路  3Comments