@@ -564,11 +564,11 @@ def _ActionsContainer_add_argument( # noqa: N802
564564 new_arg = orig_actions_container_add_argument (self , * args , ** kwargs )
565565
566566 # Set the cmd2-specific attributes
567- new_arg .set_nargs_range (nargs_range ) # type: ignore[attr-defined, ty:unresolved-attribute]
568- new_arg .set_choices_provider (choices_provider ) # type: ignore[attr-defined, ty:unresolved-attribute]
569- new_arg .set_completer (completer ) # type: ignore[attr-defined, ty:unresolved-attribute]
570- new_arg .set_suppress_tab_hint (suppress_tab_hint ) # type: ignore[attr-defined, ty:unresolved-attribute]
571- new_arg .set_table_columns (table_columns ) # type: ignore[attr-defined, ty:unresolved-attribute]
567+ new_arg .set_nargs_range (nargs_range ) # type: ignore[attr-defined] # ty: ignore[ unresolved-attribute]
568+ new_arg .set_choices_provider (choices_provider ) # type: ignore[attr-defined] # ty: ignore[ unresolved-attribute]
569+ new_arg .set_completer (completer ) # type: ignore[attr-defined] # ty: ignore[ unresolved-attribute]
570+ new_arg .set_suppress_tab_hint (suppress_tab_hint ) # type: ignore[attr-defined] # ty: ignore[ unresolved-attribute]
571+ new_arg .set_table_columns (table_columns ) # type: ignore[attr-defined] # ty: ignore[ unresolved-attribute]
572572
573573 # Set other registered custom attributes
574574 for keyword , value in custom_attribs .items ():
@@ -666,14 +666,14 @@ def _SubParsersAction_remove_all_parsers( # noqa: N802
666666 # Get the next subcommand name. remove_parser() will remove
667667 # it and any associated aliases from _name_parser_map.
668668 name = next (iter (self ._name_parser_map ))
669- record = self .remove_parser (name ) # type: ignore[attr-defined, ty:unresolved-attribute]
669+ record = self .remove_parser (name ) # type: ignore[attr-defined] # ty: ignore[ unresolved-attribute]
670670 records .append (record )
671671
672672 return records
673673
674674
675- argparse ._SubParsersAction .remove_parser = _SubParsersAction_remove_parser # type: ignore[attr-defined, ty:unresolved-attribute]
676- argparse ._SubParsersAction .remove_all_parsers = _SubParsersAction_remove_all_parsers # type: ignore[attr-defined, ty:unresolved-attribute]
675+ argparse ._SubParsersAction .remove_parser = _SubParsersAction_remove_parser # type: ignore[attr-defined] # ty: ignore[ unresolved-attribute]
676+ argparse ._SubParsersAction .remove_all_parsers = _SubParsersAction_remove_all_parsers # type: ignore[attr-defined] # ty: ignore[ unresolved-attribute]
677677
678678
679679@dataclass
@@ -747,8 +747,8 @@ def __init__(
747747 super ().__init__ (
748748 prog = prog ,
749749 usage = usage ,
750- description = description , # type: ignore[arg-type, ty:invalid-argument-type]
751- epilog = epilog , # type: ignore[arg-type, ty:invalid-argument-type]
750+ description = description , # type: ignore[arg-type] # ty: ignore[ invalid-argument-type]
751+ epilog = epilog , # type: ignore[arg-type] # ty: ignore[ invalid-argument-type]
752752 parents = parents ,
753753 formatter_class = formatter_class ,
754754 prefix_chars = prefix_chars ,
@@ -772,15 +772,15 @@ def __init__(
772772 self .description : HelpContent | None # type: ignore[assignment]
773773 self .epilog : HelpContent | None # type: ignore[assignment]
774774
775- def print_usage (self , file : IO [str ] | None = None ) -> None : # type: ignore[override, ty:invalid-method-override]
775+ def print_usage (self , file : IO [str ] | None = None ) -> None : # type: ignore[override] # ty: ignore[ invalid-method-override]
776776 """Override to ensure the formatter is aware of the target file."""
777777 if file is None :
778778 file = self ._thread_locals .current_output_file
779779
780780 with self .output_to (file ):
781781 super ().print_usage (file )
782782
783- def print_help (self , file : IO [str ] | None = None ) -> None : # type: ignore[override, ty:invalid-method-override]
783+ def print_help (self , file : IO [str ] | None = None ) -> None : # type: ignore[override] # ty: ignore[ invalid-method-override]
784784 """Override to ensure the formatter is aware of the target file."""
785785 if file is None :
786786 file = self ._thread_locals .current_output_file
@@ -984,7 +984,7 @@ def detach_subcommand(self, subcommand_path: Iterable[str], subcommand: str) ->
984984 try :
985985 record = cast (
986986 SubcommandRecord ,
987- subparsers_action .remove_parser (subcommand ), # type: ignore[attr-defined, ty:unresolved-attribute]
987+ subparsers_action .remove_parser (subcommand ), # type: ignore[attr-defined] # ty: ignore[ unresolved-attribute]
988988 )
989989 except ValueError :
990990 raise ValueError (f"Subcommand '{ subcommand } ' does not exist for '{ target_parser .prog } '" ) from None
@@ -1006,7 +1006,7 @@ def detach_all_subcommands(self, subcommand_path: Iterable[str]) -> list[Subcomm
10061006
10071007 records = cast (
10081008 list [SubcommandRecord ],
1009- subparsers_action .remove_all_parsers (), # type: ignore[attr-defined, ty:unresolved-attribute]
1009+ subparsers_action .remove_all_parsers (), # type: ignore[attr-defined] # ty: ignore[ unresolved-attribute]
10101010 )
10111011 # Update command for each detached subcommand
10121012 for record in records :
@@ -1046,7 +1046,7 @@ def format_help(self, *args: Any, **kwargs: Any) -> str:
10461046
10471047 def _get_nargs_pattern (self , action : argparse .Action ) -> str :
10481048 """Override to support nargs ranges."""
1049- nargs_range = action .get_nargs_range () # type: ignore[attr-defined, ty:unresolved-attribute]
1049+ nargs_range = action .get_nargs_range () # type: ignore[attr-defined] # ty: ignore[ unresolved-attribute]
10501050 if nargs_range :
10511051 range_max = "" if nargs_range [1 ] == constants .INFINITY else nargs_range [1 ]
10521052 nargs_pattern = f"(-*A{{{ nargs_range [0 ]} ,{ range_max } }}-*)"
@@ -1066,7 +1066,7 @@ def _match_argument(self, action: argparse.Action, arg_strings_pattern: str) ->
10661066
10671067 # raise an exception if we weren't able to find a match
10681068 if match is None :
1069- nargs_range = action .get_nargs_range () # type: ignore[attr-defined, ty:unresolved-attribute]
1069+ nargs_range = action .get_nargs_range () # type: ignore[attr-defined] # ty: ignore[ unresolved-attribute]
10701070 if nargs_range is not None :
10711071 raise ArgumentError (action , build_range_error (nargs_range [0 ], nargs_range [1 ]))
10721072
0 commit comments