11from enum import Enum
22from functools import wraps
3- from typing import List , Union , NewType , Optional , Tuple , Dict
3+ from typing import Dict , List , NewType , Optional , Tuple , Union
44
55from robot .api import logger
6-
76from robotlibcore import DynamicCore , keyword
87
98UserId = NewType ('UserId' , int )
@@ -28,14 +27,14 @@ def wrapper(*args, **kwargs):
2827
2928class CustomObject :
3029
31- def __init__ (self , x , y ):
30+ def __init__ (self , x , y ) -> None :
3231 self .x = x
3332 self .y = y
3433
3534
3635class DynamicTypesAnnotationsLibrary (DynamicCore ):
3736
38- def __init__ (self , arg : str ):
37+ def __init__ (self , arg : str ) -> None :
3938 DynamicCore .__init__ (self , [])
4039 self .instance_attribute = 'not keyword'
4140 self .arg = arg
@@ -74,7 +73,11 @@ def keyword_with_webdriver(self, arg: CustomObject):
7473 return arg
7574
7675 @keyword
77- def keyword_default_and_annotation (self : 'DynamicTypesAnnotationsLibrary' , arg1 : int , arg2 : Union [bool , str ] = False ) -> str :
76+ def keyword_default_and_annotation (
77+ self : 'DynamicTypesAnnotationsLibrary' ,
78+ arg1 : int ,
79+ arg2 : Union [bool , str ] = False
80+ ) -> str :
7881 return '{}: {}, {}: {}' .format (arg1 , type (arg1 ), arg2 , type (arg2 ))
7982
8083 @keyword (types = {'arg' : str })
@@ -90,7 +93,10 @@ def keyword_robot_types_and_bool_hint(self, arg1, arg2: bool):
9093 return '{}: {}, {}: {}' .format (arg1 , type (arg1 ), arg2 , type (arg2 ))
9194
9295 @keyword
93- def keyword_exception_annotations (self : 'DynamicTypesAnnotationsLibrary' , arg : 'NotHere' ):
96+ def keyword_exception_annotations (
97+ self : 'DynamicTypesAnnotationsLibrary' ,
98+ arg : 'NotHere' # noqa F821
99+ ):
94100 return arg
95101
96102 @keyword
@@ -124,16 +130,29 @@ def keyword_mandatory_and_keyword_only_arguments(self, arg: int, *vararg, some:
124130 return f'{ arg } , { vararg } , { some } '
125131
126132 @keyword
127- def keyword_all_args (self : 'DynamicTypesAnnotationsLibrary' , mandatory , positional = 1 , * varargs , other , value = False , ** kwargs ):
133+ def keyword_all_args (
134+ self : 'DynamicTypesAnnotationsLibrary' ,
135+ mandatory ,
136+ positional = 1 ,
137+ * varargs ,
138+ other ,
139+ value = False ,
140+ ** kwargs
141+ ):
128142 return True
129143
130144 @keyword
131145 def keyword_self_and_types (self : 'DynamicTypesAnnotationsLibrary' , mandatory : str , * varargs , other : bool , ** kwargs ):
132146 return True
133147
134148 @keyword
135- def keyword_self_and_keyword_only_types (x : 'DynamicTypesAnnotationsLibrary' , mandatory , * varargs : int , other : bool ,
136- ** kwargs : int ):
149+ def keyword_self_and_keyword_only_types (
150+ x : 'DynamicTypesAnnotationsLibrary' , # noqa: N805
151+ mandatory ,
152+ * varargs : int ,
153+ other : bool ,
154+ ** kwargs : int
155+ ):
137156 return (f'{ mandatory } : { type (mandatory )} , { varargs } : { type (varargs )} , '
138157 f'{ other } : { type (other )} , { kwargs } : { type (kwargs )} ' )
139158
0 commit comments