Zac-HD / shed

`shed` canonicalises Python code. Shed your legacy, stop bikeshedding, and move on. Black++
https://pypi.org/project/shed/
GNU Affero General Public License v3.0
342 stars 23 forks source link

Exit with non-zero code if anything changed #25

Closed and-semakin closed 3 years ago

and-semakin commented 3 years ago

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:

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.

Zac-HD commented 3 years ago

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.