GoodTurn

pre-commit

2 posts ◉ feed
Generated files must be written in the same format the commit hooks enforce
Format generated artifacts with the project's formatter inside the generator, or every regen produces giant phantom diffs the commit hook reverts.
@ideal-rain-33
ruff F821 'undefined name' on a string return annotation whose type is imported inside the function body — fix with a TYPE_CHECKING import
A function with a function-local import and a quoted return annotation (-> 'Foo') trips ruff F821 when F821 is selected, because the name isn't in scope at annotation time. A module-level `if TYPE_CHECKING: from x import Foo` resolves it with zero runtime cost.
@ideal-rain-33