@@ -1111,7 +1111,7 @@ def remove_settable(self, name: str) -> None:
1111
1111
def build_settables (self ) -> None :
1112
1112
"""Create the dictionary of user-settable parameters."""
1113
1113
1114
- def get_allow_style_choices (cli_self : Cmd ) -> list [str ]:
1114
+ def get_allow_style_choices (_cli_self : Cmd ) -> list [str ]:
1115
1115
"""Used to tab complete allow_style values."""
1116
1116
return [val .name .lower () for val in ansi .AllowStyle ]
1117
1117
@@ -1419,9 +1419,9 @@ def tokens_for_completion(self, line: str, begidx: int, endidx: int) -> tuple[li
1419
1419
def basic_complete (
1420
1420
self ,
1421
1421
text : str ,
1422
- line : str ,
1423
- begidx : int ,
1424
- endidx : int ,
1422
+ line : str , # noqa: ARG002
1423
+ begidx : int , # noqa: ARG002
1424
+ endidx : int , # noqa: ARG002
1425
1425
match_against : Iterable [str ],
1426
1426
) -> list [str ]:
1427
1427
"""Basic tab completion function that matches against a list of strings without considering line contents
@@ -1602,7 +1602,13 @@ def index_based_complete(
1602
1602
return matches
1603
1603
1604
1604
def path_complete (
1605
- self , text : str , line : str , begidx : int , endidx : int , * , path_filter : Optional [Callable [[str ], bool ]] = None
1605
+ self ,
1606
+ text : str ,
1607
+ line : str ,
1608
+ begidx : int , # noqa: ARG002
1609
+ endidx : int ,
1610
+ * ,
1611
+ path_filter : Optional [Callable [[str ], bool ]] = None ,
1606
1612
) -> list [str ]:
1607
1613
"""Performs completion of local file system paths.
1608
1614
@@ -2346,7 +2352,7 @@ def get_help_topics(self) -> list[str]:
2346
2352
# Filter out hidden and disabled commands
2347
2353
return [topic for topic in all_topics if topic not in self .hidden_commands and topic not in self .disabled_commands ]
2348
2354
2349
- def sigint_handler (self , signum : int , _ : Optional [FrameType ]) -> None :
2355
+ def sigint_handler (self , signum : int , _ : Optional [FrameType ]) -> None : # noqa: ARG002
2350
2356
"""Signal handler for SIGINTs which typically come from Ctrl-C events.
2351
2357
2352
2358
If you need custom SIGINT behavior, then override this method.
@@ -2402,7 +2408,7 @@ def precmd(self, statement: Union[Statement, str]) -> Statement:
2402
2408
"""
2403
2409
return Statement (statement ) if not isinstance (statement , Statement ) else statement
2404
2410
2405
- def postcmd (self , stop : bool , statement : Union [Statement , str ]) -> bool :
2411
+ def postcmd (self , stop : bool , statement : Union [Statement , str ]) -> bool : # noqa: ARG002
2406
2412
"""Hook method executed just after a command is executed by
2407
2413
[cmd2.Cmd.onecmd][].
2408
2414
@@ -3087,7 +3093,7 @@ def configure_readline() -> None:
3087
3093
# Disable completion
3088
3094
if completion_mode == utils .CompletionMode .NONE :
3089
3095
3090
- def complete_none (text : str , state : int ) -> Optional [str ]: # pragma: no cover
3096
+ def complete_none (text : str , state : int ) -> Optional [str ]: # pragma: no cover # noqa: ARG001
3091
3097
return None
3092
3098
3093
3099
complete_func = complete_none
@@ -3773,7 +3779,7 @@ def do_help(self, args: argparse.Namespace) -> None:
3773
3779
self .perror (err_msg , apply_style = False )
3774
3780
self .last_result = False
3775
3781
3776
- def print_topics (self , header : str , cmds : Optional [list [str ]], cmdlen : int , maxcol : int ) -> None :
3782
+ def print_topics (self , header : str , cmds : Optional [list [str ]], cmdlen : int , maxcol : int ) -> None : # noqa: ARG002
3777
3783
"""Print groups of commands and topics in columns and an optional header
3778
3784
Override of cmd's print_topics() to handle headers with newlines, ANSI style sequences, and wide characters.
3779
3785
@@ -5379,7 +5385,7 @@ def disable_command(self, command: str, message_to_print: str) -> None:
5379
5385
setattr (self , help_func_name , new_func )
5380
5386
5381
5387
# Set the completer to a function that returns a blank list
5382
- setattr (self , completer_func_name , lambda * args , ** kwargs : [])
5388
+ setattr (self , completer_func_name , lambda * _args , ** _kwargs : [])
5383
5389
5384
5390
def disable_category (self , category : str , message_to_print : str ) -> None :
5385
5391
"""Disable an entire category of commands.
0 commit comments