Zac-HD/shed

Exit with non-zero code if anything changed

Closed this issue · 1 comments

Thanks for the great tool!

As far as I can see, shed always exits with 0 code (success). It's not always desired behavior. For example, in CI it would be useful to know if anything changed or not. Many formatters have such an option:

  • black --check;
  • isort --check-only.

Consider adding a similar option or just changing the default behavior of the tool to return different status codes. I don't mind if shed actually formats files instead of just checking. The only thing I care about is the exit code. Otherwise, it's difficult to use shed in CI.

What's wrong with shed && git diff --exit-code? (or using pre-commit)

I can certainly see why you want to check whether anything changed, but because shed is my side-side-side project (behind hypothesis, HypoFuzz, and somewhere around the hypothesis+pytest ecosystems) , I'm keeping the feature set as small as possible.