@@ -15,6 +15,7 @@ class Plugin:
1515 version = "0.0.10"
1616
1717 ignore_abstract = False
18+ ignore_overload = False
1819 ignore_stubs = False
1920 ignore_variadic_names = False
2021 ignore_lambdas = False
@@ -35,6 +36,15 @@ def add_options(cls, option_manager: flake8.options.manager.OptionManager) -> No
3536 help = "If provided, then unused arguments for functions decorated with abstractmethod will be ignored." ,
3637 )
3738
39+ option_manager .add_option (
40+ "--unused-arguments-ignore-overload-functions" ,
41+ action = "store_true" ,
42+ parse_from_config = True ,
43+ default = cls .ignore_overload ,
44+ dest = "unused_arguments_ignore_overload_functions" ,
45+ help = "If provided, then unused arguments for functions decorated with overload will be ignored." ,
46+ )
47+
3848 option_manager .add_option (
3949 "--unused-arguments-ignore-stub-functions" ,
4050 action = "store_true" ,
@@ -89,6 +99,7 @@ def add_options(cls, option_manager: flake8.options.manager.OptionManager) -> No
8999 @classmethod
90100 def parse_options (cls , options : optparse .Values ) -> None :
91101 cls .ignore_abstract = options .unused_arguments_ignore_abstract_functions
102+ cls .ignore_overload = options .unused_arguments_ignore_overload_functions
92103 cls .ignore_stubs = options .unused_arguments_ignore_stub_functions
93104 cls .ignore_variadic_names = options .unused_arguments_ignore_variadic_names
94105 cls .ignore_lambdas = options .unused_arguments_ignore_lambdas
@@ -101,7 +112,12 @@ def run(self) -> Iterable[LintResult]:
101112
102113 for function in finder .functions :
103114 decorator_names = set (get_decorator_names (function ))
104- # ignore abtractmethods, it's not a surprise when they're empty
115+
116+ # ignore overload functions, it's not a surprise when they're empty
117+ if self .ignore_overload and "overload" in decorator_names :
118+ continue
119+
120+ # ignore abstractmethods, it's not a surprise when they're empty
105121 if self .ignore_abstract and "abstractmethod" in decorator_names :
106122 continue
107123
0 commit comments