m fix async.
Functions
FUNC fix_async
path: File or directory to scan.mode: Fix strategy to apply.dry_run: IfTrue, report locations without modifying files.
typer.Exit: If path does not exist.
while not r.is_computed(): await r.astream()
loop after each call. This only works if you passed a
streaming model option (e.g. stream=True) to the call;
otherwise the loop will finish immediately.
Best practices:
- Run with —dry-run first to review what will be changed.
- Only run a given mode once per file. The tool detects prior fixes and skips calls that already have await_result=True or a stream loop, but it is safest to treat it as a one-shot migration.
- Do not run both modes on the same file. If a stream loop is already present, add-await-result will skip that call (and vice versa).
- Most import styles are detected:
import mellea,from mellea import MelleaSession,from mellea.stdlib.functional import aact, module aliases, etc. - Calls that are already followed by
await r.avalue(),await r.astream(), or awhile not r.is_computed()loop are automatically skipped, even when nested inside if/try/for blocks.