mirror of
https://github.com/astral-sh/ruff.git
synced 2026-11-23 01:50:49 +08:00
## Summary This PR adds `is_lazy` to the AST and parser, and supports `lazy` import formatting in the formatter. The name `is_lazy` matches the [CPython AST](https://github.com/python/cpython/blob/c3fb0d9d96902774c08b199dda0479a8d31398a5/Parser/Python.asdl#L48), though we could modify it if there's demand. There are no further changes to Ruff rules or even to Ruff import sorting, since those deserve separate design discussions. I've also omitted support for flagging semantic syntax errors (e.g., `lazy import` inside `def`). See: https://github.com/astral-sh/ruff/issues/21305.