Skip to content

Commit d453fd0

Browse files
authored
Merge pull request #1381 from dbcli/RW/enable-bugbear-rule-B006-mutable-function-defaults
Enable lint rule B006: mutable function defaults
2 parents c883f20 + 1abc0f6 commit d453fd0

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

mycli/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ def connect(
407407
socket: str | None = "",
408408
charset: str | None = "",
409409
local_infile: bool = False,
410-
ssl: dict[str, Any] | None = {},
410+
ssl: dict[str, Any] | None = None,
411411
ssh_user: str | None = "",
412412
ssh_host: str | None = "",
413413
ssh_port: int = 22,

mycli/packages/special/main.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def special_command(
5757
arg_type: ArgType = ArgType.PARSED_QUERY,
5858
hidden: bool = False,
5959
case_sensitive: bool = False,
60-
aliases: list[str] = [],
60+
aliases: list[str] | None = None,
6161
) -> Callable:
6262
def wrapper(wrapped):
6363
register_special_command(
@@ -83,7 +83,7 @@ def register_special_command(
8383
arg_type: ArgType = ArgType.PARSED_QUERY,
8484
hidden: bool = False,
8585
case_sensitive: bool = False,
86-
aliases: list[str] = [],
86+
aliases: list[str] | None = None,
8787
) -> None:
8888
cmd = command.lower() if not case_sensitive else command
8989
COMMANDS[cmd] = SpecialCommand(
@@ -95,6 +95,7 @@ def register_special_command(
9595
hidden=hidden,
9696
case_sensitive=case_sensitive,
9797
)
98+
aliases = [] if aliases is None else aliases
9899
for alias in aliases:
99100
cmd = alias.lower() if not case_sensitive else alias
100101
COMMANDS[cmd] = SpecialCommand(

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ line-length = 140
6565
select = ['A', 'B', 'I', 'E', 'W', 'F', 'C4', 'PIE', 'TID']
6666
ignore = [
6767
'B005', # Multi-character strip()
68-
'B006', # TODO: Mutable data structures for argument defaults
6968
'E401', # Multiple imports on one line
7069
'E402', # Module level import not at top of file
7170
'PIE808', # range() starting with 0

0 commit comments

Comments
 (0)