Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail if changes are required #137

Open
adamchainz opened this issue Apr 27, 2016 · 3 comments
Open

Fail if changes are required #137

adamchainz opened this issue Apr 27, 2016 · 3 comments

Comments

@adamchainz
Copy link

It would be useful to use python–modernize in CI setups if it could fail when changes are required. Currently the return code is always 0 unless an error occurred during execution.

I'd suggest a --fail-if-changes-required flag, mutually exclusive with --write, that has return code 1 if changes are required.

@daira
Copy link
Contributor

daira commented May 1, 2016

That sounds like a good idea. As a workaround for lack of this feature, you can use -z in bash (http://stackoverflow.com/a/12137504/393146) to check that the output of python-modernize without the --write flag is empty.

@techtonik
Copy link
Contributor

Why not just return 1 if changes are required and --write is not specified?

@adamchainz
Copy link
Author

That would be a breaking change and could disrupt many CI scripts/tools out there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants