@@ -135,6 +135,10 @@ def is_positional_only_related(self) -> bool:
135135 # TODO: This is hacky, use error codes or something more resilient
136136 return "leading double underscore" in self .message
137137
138+ def is_keyword_only_related (self ) -> bool :
139+ """Whether or not the error is for something being (or not being) keyword-only."""
140+ return "is not keyword-only" in self .message
141+
138142 def get_description (self , concise : bool = False ) -> str :
139143 """Returns a description of the error.
140144
@@ -1864,6 +1868,7 @@ class _Arguments:
18641868 concise : bool
18651869 ignore_missing_stub : bool
18661870 ignore_positional_only : bool
1871+ ignore_keyword_only : bool
18671872 allowlist : list [str ]
18681873 generate_allowlist : bool
18691874 ignore_unused_allowlist : bool
@@ -1940,6 +1945,8 @@ def set_strict_flags() -> None: # not needed yet
19401945 continue
19411946 if args .ignore_positional_only and error .is_positional_only_related ():
19421947 continue
1948+ if args .ignore_keyword_only and error .is_keyword_only_related ():
1949+ continue
19431950 if error .object_desc in allowlist :
19441951 allowlist [error .object_desc ] = True
19451952 continue
@@ -2017,6 +2024,11 @@ def parse_options(args: list[str]) -> _Arguments:
20172024 action = "store_true" ,
20182025 help = "Ignore errors for whether an argument should or shouldn't be positional-only" ,
20192026 )
2027+ parser .add_argument (
2028+ "--ignore-keyword-only" ,
2029+ action = "store_true" ,
2030+ help = "Ignore errors for whether an argument should or shouldn't be keyword-only" ,
2031+ )
20202032 parser .add_argument (
20212033 "--allowlist" ,
20222034 "--whitelist" ,
0 commit comments