all-repos
all-repos copied to clipboard
Behavior when check_fix fails?
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?
Currently there is not, wouldn't be too difficult to add though:
https://github.com/asottile/all-repos/blob/252fe6f5488df3482a68d6d41e842ea868eb4603/all_repos/autofix_lib.py#L234
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
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 =)