[PATCH v2 20/20] rv/rvgen: add missing return type annotations

Wander Lairson Costa posted 20 patches 4 days, 4 hours ago
[PATCH v2 20/20] rv/rvgen: add missing return type annotations
Posted by Wander Lairson Costa 4 days, 4 hours ago
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 <wander@redhat.com>
---
 tools/verification/rvgen/rvgen/generator.py | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tools/verification/rvgen/rvgen/generator.py b/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"
 
-    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:
-- 
2.52.0
Re: [PATCH v2 20/20] rv/rvgen: add missing return type annotations
Posted by Gabriele Monaco 3 days, 11 hours ago
On Wed, 2026-02-04 at 11:42 -0300, Wander Lairson Costa wrote:
> 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 <wander@redhat.com>
> ---
>  tools/verification/rvgen/rvgen/generator.py | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/tools/verification/rvgen/rvgen/generator.py
> b/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>

>  
> -    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:
Re: [PATCH v2 20/20] rv/rvgen: add missing return type annotations
Posted by Wander Lairson Costa 2 days, 23 hours ago
On Thu, Feb 05, 2026 at 08:24:40AM +0100, Gabriele Monaco wrote:
> On Wed, 2026-02-04 at 11:42 -0300, Wander Lairson Costa wrote:
> > 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 <wander@redhat.com>
> > ---
> >  tools/verification/rvgen/rvgen/generator.py | 16 ++++++++--------
> >  1 file changed, 8 insertions(+), 8 deletions(-)
> > 
> > diff --git a/tools/verification/rvgen/rvgen/generator.py
> > b/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.

I was uncertain if I should send now or postpone it, to be fair.

> 
> Reviewed-by: Gabriele Monaco <gmonaco@redhat.com>
> 
> >  
> > -    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:
>