Use comprehension syntax instead of list()/set() around generators

Proprietary

Wrapping a generator in list() or set() is less idiomatic than the equivalent bracket/brace comprehension syntax. It only fires where list or set resolves to the builtin, and not for a generator that awaits, which list() cannot iterate.

org.openrewrite.python.cleanup.CollectionBuiltinToComprehension
mod run . --recipe=org.openrewrite.python.cleanup.CollectionBuiltinToComprehension

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.