Re: [PATCH v2 20/20] rv/rvgen: add missing return type annotations
flat view
From: Gabriele Monaco <gmonaco@redhat.com>
Date: 2026-02-05 07:24:57
Also in:
lkml
On Wed, 2026-02-04 at 11:42 -0300, Wander Lairson Costa wrote:
quoted hunk ↗ jump to hunk
Add missing `-> str` return type annotations to code generation methods in RVGenerator. These methods return strings, and the missing hints caused errors with static analysis tools. Signed-off-by: Wander Lairson Costa <redacted> --- tools/verification/rvgen/rvgen/generator.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)diff --git a/tools/verification/rvgen/rvgen/generator.pyb/tools/verification/rvgen/rvgen/generator.py index ef6c9150f50c6..4b984869a7b3d 100644--- a/tools/verification/rvgen/rvgen/generator.py +++ b/tools/verification/rvgen/rvgen/generator.py@@ -73,13 +73,13 @@ class RVGenerator:return f"#include <monitors/{self.parent}/{self.parent}.h>\n" return "" - def fill_tracepoint_handlers_skel(self): + def fill_tracepoint_handlers_skel(self) -> str: return "NotImplemented"
Those are the ones that will raise an exception in a later iteration of this, right? I wonder if we really need to touch them now. Anyway I'm fine with this if it pleases your tools, thanks. Reviewed-by: Gabriele Monaco <gmonaco@redhat.com>
quoted hunk ↗ jump to hunk
- def fill_tracepoint_attach_probe(self): + def fill_tracepoint_attach_probe(self) -> str: return "NotImplemented" - def fill_tracepoint_detach_helper(self): + def fill_tracepoint_detach_helper(self) -> str: return "NotImplemented" def fill_main_c(self):@@ -100,19 +100,19 @@ class RVGenerator:return main_c - def fill_model_h(self): + def fill_model_h(self) -> str: return "NotImplemented" - def fill_monitor_class_type(self): + def fill_monitor_class_type(self) -> str: return "NotImplemented" - def fill_monitor_class(self): + def fill_monitor_class(self) -> str: return "NotImplemented" - def fill_tracepoint_args_skel(self, tp_type): + def fill_tracepoint_args_skel(self, tp_type) -> str: return "NotImplemented" - def fill_monitor_deps(self): + def fill_monitor_deps(self) -> str: buff = [] buff.append(" # XXX: add dependencies if there") if self.parent: