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

Behavior when check_fix fails? #80

Open
sloria opened this issue Jan 20, 2019 · 2 comments
Open

Behavior when check_fix fails? #80

sloria opened this issue Jan 20, 2019 · 2 comments

Comments

@sloria
Copy link
Contributor

sloria commented Jan 20, 2019

Currently when an autofixer's check_fix function exits with an exception in --interactive mode, the command exits without a way to fix issues. Is there a way to fix the issues found by check_fix before proceeding?

@asottile
Copy link
Owner

Currently there is not, wouldn't be too difficult to add though:

probably something like:

while True:
    try:
        check_fix()
    except Exception:
        if settings.interactive:
            if not _interactive_check(use_color=autofix_settings.color):
                return
            else:
                continue
        else:
            raise

@sloria
Copy link
Contributor Author

sloria commented Jan 20, 2019

Awesome. I've worked around the issue for now by just commenting out check_fix for the one repo I needed to fix, so I'm not blocked.

Maybe I'll send a PR for this if I have some extra time, but don't hold me to it =)

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

2 participants