Adds a new check ASYNC913, indefinite-loop-no-guaranteed-checkpoint.
Will likely have some minor merge conflicts with #254
Fixes #240.
Together with #254 it fixes the example given in #227. The error will be for the loop though, and not the context manager.
I also noticed a few bugs when implementing it, that also are fixed
ASYNC911 crashed when trying to autofix
while True: yield
because the autofix assumed the loop body was an IndentedBlock.
ASYNC911 didn't add a library import when using InsertCheckPointsInLoopBody, i.e. when a checkpoint was needed due to the artificial statement injected at start of loop body. See eval_files/async911_insert_library.py
ASYNC910 didn't add a library import when adding a checkpoint at the end of a function body. (as opposed to before a return). See eval_files/async910_insert_library.py
Adds a new check ASYNC913, indefinite-loop-no-guaranteed-checkpoint.
Will likely have some minor merge conflicts with #254 Fixes #240. Together with #254 it fixes the example given in #227. The error will be for the loop though, and not the context manager.
I also noticed a few bugs when implementing it, that also are fixed
because the autofix assumed the loop body was an
IndentedBlock
.return
). See eval_files/async910_insert_library.py