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!
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!
Most helpful comment
@michaelmcguire the
--lintoption has landed in version 0.33.13. Thanks!