PyCQA / modernize

Modernizes Python code for eventual Python 3 migration. Built on top of fissix (a fork of lib2to3)
https://modernize.readthedocs.org/
Other
353 stars 51 forks source link

Add a flag to python-moderinze to return a non-zero exit code if any fixers needed to be applied. #147

Closed rowillia closed 7 years ago

rowillia commented 7 years ago

This is very useful for us when using python-moderize in CI to ensure we don't regress Python 3 compat. Otherwise, we have to roll our own way using git. For example:

https://github.com/zulip/zulip/blob/master/tools/check-py3#L103

bruce-lyft commented 7 years ago

Is there any reason not to default this behavior on? It is a pretty standard unix convention.

rowillia commented 7 years ago

@brettcannon @takluyver One more for you 😄

brettcannon commented 7 years ago

Don't have time right this second to check the code is right, but the concept works for me. As for why this isn't on by default, @bruce-lyft , it is a breaking change to the CLI API.

rowillia commented 7 years ago

Thanks for taking a look @brettcannon and @takluyver ! Addressed feedback and added tests.

brettcannon commented 7 years ago

LGTM. @takluyver ?

rowillia commented 7 years ago

@takluyver ping!

takluyver commented 7 years ago

Pong ;-)

rowillia commented 7 years ago

Thanks @takluyver !