From 8d2a41cfdcb3edfa041e8cd26d8f84cfb684b747 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 24 Jul 2024 11:22:06 -0700 Subject: backends/ninja: Add annotation for NinjaBuildElement.rule This is a bit of a hack, since the rule is added outside of the `__init__` method, and that's probably bad. But at least we can get some additional help by telling type checkers what it will be --- mesonbuild/backend/ninjabackend.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index b67d8619f..20ba67fff 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -306,6 +306,9 @@ class NinjaRule: return estimate class NinjaBuildElement: + + rule: NinjaRule + def __init__(self, all_outputs: T.Set[str], outfilenames, rulename, infilenames, implicit_outs=None): self.implicit_outfilenames = implicit_outs or [] if isinstance(outfilenames, str): -- cgit v1.2.3