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

Allow external fixers on command-line tool #166

Closed
shaib opened this issue Apr 24, 2018 · 2 comments
Closed

Allow external fixers on command-line tool #166

shaib opened this issue Apr 24, 2018 · 2 comments

Comments

@shaib
Copy link
Contributor

shaib commented Apr 24, 2018

The section on Fixers at https://python-modernize.readthedocs.io/en/latest/fixers.html ends with a note about "implementing your own fixers"; however, libmodernize.main.main collects the available fixers from libmodernize.fixes and lib2to3.fixes, and if a fixer not found in these two places is specified on the command line, errors out with "Error: fix '{}' was not found".

It would be more helpful to try to import and load the fixer in such cases. if a fix explicitly mentioned was not found, an attempt should be made to import and load it.

I note that modernize has inherited this behavior from 2to3 -- but the only reason I see for it is to make sure that -l indeed provides a full list; a problem which could be addressed by changing that option's help-string, IMO.

@takluyver
Copy link
Contributor

Makes sense, PRs welcome :-)

@shaib
Copy link
Contributor Author

shaib commented Apr 30, 2018

Just for the record, #167

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

No branches or pull requests

2 participants