these 3 derivations will be built: /nix/store/xn83bj7vpzddni06z2pfzx73v264scrz-treefmt.toml.drv /nix/store/njq5f0hckqai1rl2wikh9frldf1mhxzy-treefmt.drv /nix/store/5aj9vkblzc58d7jss6n8iiqwpcs6lxsa-treefmt-check.drv building '/nix/store/xn83bj7vpzddni06z2pfzx73v264scrz-treefmt.toml.drv' on 'ssh-ng://customer@mac02' building '/nix/store/xn83bj7vpzddni06z2pfzx73v264scrz-treefmt.toml.drv' treefmt.toml> structuredAttrs is enabled building '/nix/store/njq5f0hckqai1rl2wikh9frldf1mhxzy-treefmt.drv' on 'ssh-ng://customer@mac02' building '/nix/store/njq5f0hckqai1rl2wikh9frldf1mhxzy-treefmt.drv' building '/nix/store/5aj9vkblzc58d7jss6n8iiqwpcs6lxsa-treefmt-check.drv' on 'ssh-ng://customer@mac02' building '/nix/store/5aj9vkblzc58d7jss6n8iiqwpcs6lxsa-treefmt-check.drv' treefmt-check> treefmt v2.5.0ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 1 treefmt-check> treefmt-check> EXE001 Shebang is present but file is not executable treefmt-check> --> doc/generate_command_reference.py:1:1 treefmt-check> | treefmt-check> 1 | #!/usr/bin/env python treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 2 | treefmt-check> 3 | import os.path treefmt-check> | treefmt-check> treefmt-check> BLE001 Do not catch blind exception: `Exception` treefmt-check> --> examples/asyncio_example.py:15:12 treefmt-check> | treefmt-check> 13 | try: treefmt-check> 14 | await client.connect("localhost", 6600) treefmt-check> 15 | except Exception as e: treefmt-check> | ^^^^^^^^^ treefmt-check> 16 | print("Connection failed:", e) treefmt-check> 17 | return treefmt-check> | treefmt-check> treefmt-check> BLE001 Do not catch blind exception: `Exception` treefmt-check> --> examples/asyncio_example.py:23:12 treefmt-check> | treefmt-check> 21 | try: treefmt-check> 22 | status = await client.status() treefmt-check> 23 | except Exception as e: treefmt-check> | ^^^^^^^^^ treefmt-check> 24 | print("Status error:", e) treefmt-check> 25 | return treefmt-check> | treefmt-check> treefmt-check> BLE001 Do not catch blind exception: `Exception` treefmt-check> --> examples/asyncio_example.py:47:12 treefmt-check> | treefmt-check> 45 | try: treefmt-check> 46 | await client.addid() treefmt-check> 47 | except Exception as e: treefmt-check> | ^^^^^^^^^ treefmt-check> 48 | print("An erroneous command, as expected, raised:", e) treefmt-check> | treefmt-check> treefmt-check> BLE001 Do not catch blind exception: `Exception` treefmt-check> --> examples/asyncio_example.py:53:12 treefmt-check> | treefmt-check> 51 | async for x in client.plchangesposid(): treefmt-check> 52 | print("Why does this work?") treefmt-check> 53 | except Exception as e: treefmt-check> | ^^^^^^^^^ treefmt-check> 54 | print("An erroneous asynchronously looped command, as expected, raised:", e) treefmt-check> | treefmt-check> treefmt-check> EXE001 Shebang is present but file is not executable treefmt-check> --> examples/coverart.py:1:1 treefmt-check> | treefmt-check> 1 | #!/usr/bin/env python treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 2 | treefmt-check> 3 | # IMPORTS treefmt-check> | treefmt-check> treefmt-check> TRY201 Use `raise` without specifying exception name treefmt-check> --> examples/coverart.py:39:15 treefmt-check> | treefmt-check> 37 | # mpd.base.CommandError: [50@0] {albumart} No file exists treefmt-check> 38 | if error.errno is not FailureResponseCode.NO_EXIST: treefmt-check> 39 | raise error treefmt-check> | ^^^^^ treefmt-check> 40 | treefmt-check> 41 | try: treefmt-check> | treefmt-check> help: Remove exception name treefmt-check> treefmt-check> EXE001 Shebang is present but file is not executable treefmt-check> --> examples/errorhandling.py:1:1 treefmt-check> | treefmt-check> 1 | #! /usr/bin/env python treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 2 | # treefmt-check> 3 | # Introduction treefmt-check> | treefmt-check> treefmt-check> RUF059 Unpacked variable `errno` is never used treefmt-check> --> examples/errorhandling.py:30:13 treefmt-check> | treefmt-check> 28 | # Catch socket errors treefmt-check> 29 | except OSError as err: treefmt-check> 30 | errno, strerror = err treefmt-check> | ^^^^^ treefmt-check> 31 | raise PollerError("Could not connect to '%s': %s" % (self._host, strerror)) treefmt-check> | treefmt-check> help: Prefix it with an underscore or any other dummy variable pattern treefmt-check> treefmt-check> UP031 Use format specifiers instead of percent format treefmt-check> --> examples/errorhandling.py:31:31 treefmt-check> | treefmt-check> 29 | except OSError as err: treefmt-check> 30 | errno, strerror = err treefmt-check> 31 | raise PollerError("Could not connect to '%s': %s" % (self._host, strerror)) treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 32 | treefmt-check> 33 | # Catch all other possible errors treefmt-check> | treefmt-check> help: Replace with format specifiers treefmt-check> treefmt-check> UP031 Use format specifiers instead of percent format treefmt-check> --> examples/errorhandling.py:38:31 treefmt-check> | treefmt-check> 36 | # they are instead of ignoring them. treefmt-check> 37 | except MPDError as e: treefmt-check> 38 | raise PollerError("Could not connect to '%s': %s" % (self._host, e)) treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 39 | treefmt-check> 40 | if self._password: treefmt-check> | treefmt-check> help: Replace with format specifiers treefmt-check> treefmt-check> UP031 Use format specifiers instead of percent format treefmt-check> --> examples/errorhandling.py:49:21 treefmt-check> | treefmt-check> 47 | # split into errno, offset, command and msg. treefmt-check> 48 | raise PollerError( treefmt-check> 49 | / "Could not connect to '%s': " treefmt-check> 50 | | "password commmand failed: [%d] %s" % (self._host, e.errno, e.msg) treefmt-check> | |_______________________________________________________^ treefmt-check> 51 | ) treefmt-check> | treefmt-check> help: Replace with format specifiers treefmt-check> treefmt-check> UP031 Use format specifiers instead of percent format treefmt-check> --> examples/errorhandling.py:56:21 treefmt-check> | treefmt-check> 54 | except (OSError, MPDError) as e: treefmt-check> 55 | raise PollerError( treefmt-check> 56 | / "Could not connect to '%s': " treefmt-check> 57 | | "error with password command: %s" % (self._host, e) treefmt-check> | |_______________________________________________________________________^ treefmt-check> 58 | ) treefmt-check> | treefmt-check> help: Replace with format specifiers treefmt-check> treefmt-check> UP031 Use format specifiers instead of percent format treefmt-check> --> examples/errorhandling.py:94:35 treefmt-check> | treefmt-check> 92 | # Reconnecting failed treefmt-check> 93 | except PollerError as e: treefmt-check> 94 | raise PollerError("Reconnecting failed: %s" % e) treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 95 | treefmt-check> 96 | try: treefmt-check> | treefmt-check> help: Replace with format specifiers treefmt-check> treefmt-check> UP031 Use format specifiers instead of percent format treefmt-check> --> examples/errorhandling.py:101:35 treefmt-check> | treefmt-check> 99 | # Failed again, just give up treefmt-check> 100 | except (OSError, MPDError) as e: treefmt-check> 101 | raise PollerError("Couldn't retrieve current song: %s" % e) treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 102 | treefmt-check> 103 | # Hurray! We got the current song without any errors! treefmt-check> | treefmt-check> help: Replace with format specifiers treefmt-check> treefmt-check> UP031 Use format specifiers instead of percent format treefmt-check> --> examples/errorhandling.py:126:15 treefmt-check> | treefmt-check> 124 | # Catch fatal poller errors treefmt-check> 125 | except PollerError as e: treefmt-check> 126 | print("Fatal poller error: %s" % e, file=sys.stderr) treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 127 | sys.exit(1) treefmt-check> | treefmt-check> help: Replace with format specifiers treefmt-check> treefmt-check> BLE001 Do not catch blind exception: `Exception` treefmt-check> --> examples/errorhandling.py:130:12 treefmt-check> | treefmt-check> 129 | # Catch all other non-exit errors treefmt-check> 130 | except Exception as e: treefmt-check> | ^^^^^^^^^ treefmt-check> 131 | print("Unexpected exception: %s" % e, file=sys.stderr) treefmt-check> 132 | sys.exit(1) treefmt-check> | treefmt-check> treefmt-check> UP031 Use format specifiers instead of percent format treefmt-check> --> examples/errorhandling.py:131:15 treefmt-check> | treefmt-check> 129 | # Catch all other non-exit errors treefmt-check> 130 | except Exception as e: treefmt-check> 131 | print("Unexpected exception: %s" % e, file=sys.stderr) treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 132 | sys.exit(1) treefmt-check> | treefmt-check> help: Replace with format specifiers treefmt-check> treefmt-check> BLE001 Do not catch blind exception: `Exception` treefmt-check> --> examples/errorhandling.py:135:12 treefmt-check> | treefmt-check> 134 | # Catch the remaining exit errors treefmt-check> 135 | except Exception: treefmt-check> | ^^^^^^^^^ treefmt-check> 136 | sys.exit(0) treefmt-check> | treefmt-check> treefmt-check> B025 try-except block with duplicate exception `Exception` treefmt-check> --> examples/errorhandling.py:135:12 treefmt-check> | treefmt-check> 134 | # Catch the remaining exit errors treefmt-check> 135 | except Exception: treefmt-check> | ^^^^^^^^^ treefmt-check> 136 | sys.exit(0) treefmt-check> | treefmt-check> treefmt-check> EXE001 Shebang is present but file is not executable treefmt-check> --> examples/helloworld.py:1:1 treefmt-check> | treefmt-check> 1 | #!/usr/bin/python treefmt-check> | ^^^^^^^^^^^^^^^^^ treefmt-check> 2 | import mpd treefmt-check> | treefmt-check> treefmt-check> UP031 Use format specifiers instead of percent format treefmt-check> --> examples/helloworld.py:8:11 treefmt-check> | treefmt-check> 7 | for entry in client.lsinfo("/"): treefmt-check> 8 | print("%s" % entry) treefmt-check> | ^^^^^^^^^^^^ treefmt-check> 9 | for key, value in client.status().items(): treefmt-check> 10 | print("%s: %s" % (key, value)) treefmt-check> | treefmt-check> help: Replace with format specifiers treefmt-check> treefmt-check> UP031 Use format specifiers instead of percent format treefmt-check> --> examples/helloworld.py:10:11 treefmt-check> | treefmt-check> 8 | print("%s" % entry) treefmt-check> 9 | for key, value in client.status().items(): treefmt-check> 10 | print("%s: %s" % (key, value)) treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> help: Replace with format specifiers treefmt-check> treefmt-check> EXE001 Shebang is present but file is not executable treefmt-check> --> examples/randomqueue.py:1:1 treefmt-check> | treefmt-check> 1 | #!/usr/bin/env python treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 2 | treefmt-check> 3 | # IMPORTS treefmt-check> | treefmt-check> treefmt-check> EXE001 Shebang is present but file is not executable treefmt-check> --> examples/stats.py:1:1 treefmt-check> | treefmt-check> 1 | #!/usr/bin/env python treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 2 | treefmt-check> 3 | # IMPORTS treefmt-check> | treefmt-check> treefmt-check> EXE001 Shebang is present but file is not executable treefmt-check> --> examples/stickers.py:26:1 treefmt-check> | treefmt-check> 24 | # sticker.py treefmt-check> 25 | treefmt-check> 26 | #! /usr/bin/env python treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 27 | treefmt-check> 28 | from optparse import OptionParser treefmt-check> | treefmt-check> treefmt-check> EXE005 Shebang should be at the beginning of the file treefmt-check> --> examples/stickers.py:26:1 treefmt-check> | treefmt-check> 24 | # sticker.py treefmt-check> 25 | treefmt-check> 26 | #! /usr/bin/env python treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 27 | treefmt-check> 28 | from optparse import OptionParser treefmt-check> | treefmt-check> treefmt-check> UP031 Use format specifiers instead of percent format treefmt-check> --> examples/stickers.py:74:22 treefmt-check> | treefmt-check> 73 | if len(args) < 1: treefmt-check> 74 | parser.error("no action specified, must be one of: %s" % " ".join(ACTIONS)) treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 75 | action = args.pop(0) treefmt-check> | treefmt-check> help: Replace with format specifiers treefmt-check> treefmt-check> UP031 Use format specifiers instead of percent format treefmt-check> --> examples/stickers.py:78:22 treefmt-check> | treefmt-check> 77 | if action not in ACTIONS: treefmt-check> 78 | parser.error("action must be one of: %s" % " ".join(ACTIONS)) treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 79 | treefmt-check> 80 | if len(args) < 1: treefmt-check> | treefmt-check> help: Replace with format specifiers treefmt-check> treefmt-check> UP031 Use format specifiers instead of percent format treefmt-check> --> examples/stickers.py:102:13 treefmt-check> | treefmt-check> 100 | except OSError as e: treefmt-check> 101 | print( treefmt-check> 102 | "%s: error with connection to MPD: %s" % (parser.get_prog_name(), e[1]), treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 103 | file=stderr, treefmt-check> 104 | ) treefmt-check> | treefmt-check> help: Replace with format specifiers treefmt-check> treefmt-check> UP031 Use format specifiers instead of percent format treefmt-check> --> examples/stickers.py:107:13 treefmt-check> | treefmt-check> 105 | except MPDError as e: treefmt-check> 106 | print( treefmt-check> 107 | "%s: error executing action: %s" % (parser.get_prog_name(), e), file=stderr treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 108 | ) treefmt-check> | treefmt-check> help: Replace with format specifiers treefmt-check> treefmt-check> TRY002 Create your own exception treefmt-check> --> mpd/__init__.py:37:19 treefmt-check> | treefmt-check> 35 | class MPDProtocolDummy: treefmt-check> 36 | def __init__(self) -> None: treefmt-check> 37 | raise Exception("No twisted module found") treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 38 | treefmt-check> 39 | MPDProtocol = MPDProtocolDummy # type: ignore treefmt-check> | treefmt-check> treefmt-check> BLE001 Do not catch blind exception: `Exception` treefmt-check> --> mpd/asyncio.py:157:16 treefmt-check> | treefmt-check> 155 | async for r in self: treefmt-check> 156 | result.append(r) treefmt-check> 157 | except Exception as e: treefmt-check> | ^^^^^^^^^ treefmt-check> 158 | self.set_exception(e) treefmt-check> 159 | else: treefmt-check> | treefmt-check> treefmt-check> C405 Unnecessary list literal (rewrite as a set literal) treefmt-check> --> mpd/asyncio.py:339:38 treefmt-check> | treefmt-check> 337 | # The presumably most quiet subsystem -- in this case, treefmt-check> 338 | # idle is only used to keep the connection alive. treefmt-check> 339 | subsystems = set(["database"]) treefmt-check> | ^^^^^^^^^^^^^^^^^ treefmt-check> 340 | treefmt-check> 341 | # Careful: There can't be any await points between the treefmt-check> | treefmt-check> help: Rewrite as a set literal treefmt-check> treefmt-check> B006 Do not use mutable data structures for argument defaults treefmt-check> --> mpd/asyncio.py:472:33 treefmt-check> | treefmt-check> 470 | self, treefmt-check> 471 | lines: "asyncio.Queue[str]", treefmt-check> 472 | delimiters: list[str] = [], treefmt-check> | ^^ treefmt-check> 473 | lookup_delimiter: bool = False, treefmt-check> 474 | ) -> AsyncIterator[dict[str, str]]: treefmt-check> | treefmt-check> help: Replace with `None`; initialize within function treefmt-check> treefmt-check> T100 Trace found: `breakpoint` used treefmt-check> --> mpd/asyncio.py:546:17 treefmt-check> | treefmt-check> 544 | args[-1] = len(data) treefmt-check> 545 | if len(data) > size: treefmt-check> 546 | breakpoint() treefmt-check> | ^^^^^^^^^^^^ treefmt-check> 547 | raise CommandListError("Binary data announced size exceeded") treefmt-check> 548 | elif len(data) == size: treefmt-check> | treefmt-check> treefmt-check> ISC004 Unparenthesized implicit string concatenation in collection treefmt-check> --> mpd/asyncio.py:618:25 treefmt-check> | treefmt-check> 616 | except asyncio.QueueFull as e: treefmt-check> 617 | e.args = ( treefmt-check> 618 | / "Command queue overflowing; this indicates the" treefmt-check> 619 | | " application sending commands in an uncontrolled" treefmt-check> 620 | | " fashion without awaiting them, and typically" treefmt-check> 621 | | " indicates a memory leak.", treefmt-check> | |___________________________________________________^ treefmt-check> 622 | ) treefmt-check> 623 | # While we *could* indicate to the queued result that it has treefmt-check> | treefmt-check> help: Did you forget a comma? treefmt-check> help: Wrap implicitly concatenated strings in parentheses treefmt-check> treefmt-check> BLE001 Do not catch blind exception: `BaseException` treefmt-check> --> mpd/asyncio.py:639:24 treefmt-check> | treefmt-check> 637 | try: treefmt-check> 638 | self._write_command(result._command, result._args) treefmt-check> 639 | except BaseException as e: treefmt-check> | ^^^^^^^^^^^^^ treefmt-check> 640 | self.disconnect() treefmt-check> 641 | result.set_exception(e) treefmt-check> | treefmt-check> treefmt-check> B006 Do not use mutable data structures for argument defaults treefmt-check> --> mpd/asyncio.py:650:52 treefmt-check> | treefmt-check> 648 | # commands that just work differently treefmt-check> 649 | async def idle( treefmt-check> 650 | self, subsystems: list[str] | tuple[str] = [] treefmt-check> | ^^ treefmt-check> 651 | ) -> AsyncIterator[list[str] | Exception]: treefmt-check> 652 | if self.__idle_consumers is None: treefmt-check> | treefmt-check> help: Replace with `None`; initialize within function treefmt-check> treefmt-check> UP031 Use format specifiers instead of percent format treefmt-check> --> mpd/base.py:127:17 treefmt-check> | treefmt-check> 125 | if kwargs: treefmt-check> 126 | raise AttributeError( treefmt-check> 127 | "mpd_commands() got unexpected keyword arguments %s" % ",".join(kwargs) treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 128 | ) treefmt-check> | treefmt-check> help: Replace with format specifiers treefmt-check> treefmt-check> B006 Do not use mutable data structures for argument defaults treefmt-check> --> mpd/base.py:213:33 treefmt-check> | treefmt-check> 211 | self, treefmt-check> 212 | lines: Iterable[str], treefmt-check> 213 | delimiters: list[str] = [], treefmt-check> | ^^ treefmt-check> 214 | lookup_delimiter: bool = False, treefmt-check> 215 | ) -> Iterator[dict[str, str]]: treefmt-check> | treefmt-check> help: Replace with `None`; initialize within function treefmt-check> treefmt-check> RUF059 Unpacked variable `key` is never used treefmt-check> --> mpd/base.py:419:9 treefmt-check> | treefmt-check> 417 | @mpd_commands("sticker get") treefmt-check> 418 | def _parse_sticker(self, lines: list[str]) -> str: treefmt-check> 419 | key, value = list(self._parse_raw_stickers(lines))[0] treefmt-check> | ^^^ treefmt-check> 420 | return value treefmt-check> | treefmt-check> help: Prefix it with an underscore or any other dummy variable pattern treefmt-check> treefmt-check> RUF015 Prefer `next(iter(self._parse_raw_stickers(lines)))` over single element slice treefmt-check> --> mpd/base.py:419:22 treefmt-check> | treefmt-check> 417 | @mpd_commands("sticker get") treefmt-check> 418 | def _parse_sticker(self, lines: list[str]) -> str: treefmt-check> 419 | key, value = list(self._parse_raw_stickers(lines))[0] treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 420 | return value treefmt-check> | treefmt-check> help: Replace with `next(iter(self._parse_raw_stickers(lines)))` treefmt-check> treefmt-check> B006 Do not use mutable data structures for argument defaults treefmt-check> --> mpd/base.py:440:59 treefmt-check> | treefmt-check> 439 | def collect( treefmt-check> 440 | cls: Any, callbacks: dict[str, tuple[Any, Any]] = {} treefmt-check> | ^^ treefmt-check> 441 | ) -> dict[str, tuple[Any, Any]]: treefmt-check> 442 | """Collect MPD command callbacks from given class. treefmt-check> | treefmt-check> help: Replace with `None`; initialize within function treefmt-check> treefmt-check> PERF102 When using only the values of a dict use the `values()` method treefmt-check> --> mpd/base.py:456:24 treefmt-check> | treefmt-check> 454 | return callbacks treefmt-check> 455 | treefmt-check> 456 | for name, value in collect(cls).items(): treefmt-check> | ^^^^^^^^^^^^^^^^^^ treefmt-check> 457 | callback, from_ = value treefmt-check> 458 | for command in callback.mpd_commands: treefmt-check> | treefmt-check> help: Replace `.items()` with `.values()` treefmt-check> treefmt-check> RUF059 Unpacked variable `from_` is never used treefmt-check> --> mpd/base.py:457:19 treefmt-check> | treefmt-check> 456 | for name, value in collect(cls).items(): treefmt-check> 457 | callback, from_ = value treefmt-check> | ^^^^^ treefmt-check> 458 | for command in callback.mpd_commands: treefmt-check> 459 | cls.add_command(command, callback) treefmt-check> | treefmt-check> help: Prefix it with an underscore or any other dummy variable pattern treefmt-check> treefmt-check> RUF012 Mutable default value for class attribute treefmt-check> --> mpd/base.py:506:30 treefmt-check> | treefmt-check> 504 | idletimeout = None treefmt-check> 505 | _timeout = None treefmt-check> 506 | _wrap_iterator_parsers = [ treefmt-check> | ______________________________^ treefmt-check> 507 | | MPDClientBase._parse_list, treefmt-check> 508 | | MPDClientBase._parse_list_groups, treefmt-check> 509 | | MPDClientBase._parse_playlist, treefmt-check> 510 | | MPDClientBase._parse_changes, treefmt-check> 511 | | MPDClientBase._parse_songs, treefmt-check> 512 | | MPDClientBase._parse_mounts, treefmt-check> 513 | | MPDClientBase._parse_neighbors, treefmt-check> 514 | | MPDClientBase._parse_partitions, treefmt-check> 515 | | MPDClientBase._parse_playlists, treefmt-check> 516 | | MPDClientBase._parse_database, treefmt-check> 517 | | MPDClientBase._parse_messages, treefmt-check> 518 | | MPDClientBase._parse_outputs, treefmt-check> 519 | | MPDClientBase._parse_plugins, treefmt-check> 520 | | ] treefmt-check> | |_____^ treefmt-check> 521 | treefmt-check> 522 | def __init__(self, use_unicode: bool | None = None) -> None: treefmt-check> | treefmt-check> help: Consider initializing in `__init__` or annotating with `typing.ClassVar` treefmt-check> treefmt-check> B006 Do not use mutable data structures for argument defaults treefmt-check> --> mpd/base.py:567:62 treefmt-check> | treefmt-check> 565 | raise e.with_traceback(sys.exc_info()[2]) treefmt-check> 566 | treefmt-check> 567 | def _write_command(self, command: str, args: list[Any] = []) -> None: treefmt-check> | ^^ treefmt-check> 568 | parts = [command] treefmt-check> 569 | for arg in args: treefmt-check> | treefmt-check> help: Replace with `None`; initialize within function treefmt-check> treefmt-check> UP031 Use format specifiers instead of percent format treefmt-check> --> mpd/base.py:648:25 treefmt-check> | treefmt-check> 646 | self.disconnect() treefmt-check> 647 | raise ConnectionError( treefmt-check> 648 | / "Connection lost while reading binary data: " treefmt-check> 649 | | "expected %d bytes, got %d" % (chunk_size, len(value)) treefmt-check> | |___________________________________________________^ treefmt-check> 650 | ) treefmt-check> | treefmt-check> help: Replace with format specifiers treefmt-check> treefmt-check> UP028 Replace `yield` over `for` loop with `yield from` treefmt-check> --> mpd/base.py:735:13 treefmt-check> | treefmt-check> 733 | ) -> Iterator[dict[str, str]]: treefmt-check> 734 | try: treefmt-check> 735 | / for item in iterator: treefmt-check> 736 | | yield item treefmt-check> | |__________________________^ treefmt-check> 737 | finally: treefmt-check> 738 | self._iterating = False treefmt-check> | treefmt-check> help: Replace with `yield from` treefmt-check> treefmt-check> RUF059 Unpacked variable `canonname` is never used treefmt-check> --> mpd/base.py:775:34 treefmt-check> | treefmt-check> 773 | socket.AI_ADDRCONFIG, treefmt-check> 774 | ): treefmt-check> 775 | af, socktype, proto, canonname, sa = res treefmt-check> | ^^^^^^^^^ treefmt-check> 776 | sock = None treefmt-check> 777 | try: treefmt-check> | treefmt-check> help: Prefix it with an underscore or any other dummy variable pattern treefmt-check> treefmt-check> UP031 Use format specifiers instead of percent format treefmt-check> --> mpd/tests.py:1269:24 treefmt-check> | treefmt-check> 1267 | next_write = self._expectations[0][0][0] treefmt-check> 1268 | except IndexError: treefmt-check> 1269 | self.error("Data written to mock even though none expected: %r" % data) treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 1270 | if next_write == data: treefmt-check> 1271 | self._expectations[0][0].pop(0) treefmt-check> | treefmt-check> help: Replace with format specifiers treefmt-check> treefmt-check> UP031 Use format specifiers instead of percent format treefmt-check> --> mpd/tests.py:1274:24 treefmt-check> | treefmt-check> 1272 | self._feed() treefmt-check> 1273 | else: treefmt-check> 1274 | self.error("Mock got %r, expected %r" % (data, next_write)) treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 1275 | treefmt-check> 1276 | def close(self) -> None: treefmt-check> | treefmt-check> help: Replace with format specifiers treefmt-check> treefmt-check> B006 Do not use mutable data structures for argument defaults treefmt-check> --> mpd/twisted.py:153:47 treefmt-check> | treefmt-check> 151 | @lock treefmt-check> 152 | def _execute( treefmt-check> 153 | self, command: str, args: list[str] = [], parser: Callable | None = None treefmt-check> | ^^ treefmt-check> 154 | ) -> defer.Deferred: treefmt-check> 155 | # close or kill command in command list not allowed treefmt-check> | treefmt-check> help: Replace with `None`; initialize within function treefmt-check> treefmt-check> B006 Do not use mutable data structures for argument defaults treefmt-check> --> mpd/twisted.py:178:63 treefmt-check> | treefmt-check> 176 | return deferred treefmt-check> 177 | treefmt-check> 178 | def _create_command(self, command: str, args: list[str] = []) -> bytes: treefmt-check> | ^^ treefmt-check> 179 | # XXX: this function should be generalized in future. There exists treefmt-check> 180 | # almost identical code in ``MPDClient._write_command``, with the treefmt-check> | treefmt-check> help: Replace with `None`; initialize within function treefmt-check> treefmt-check> B006 Do not use mutable data structures for argument defaults treefmt-check> --> mpd/twisted.py:195:62 treefmt-check> | treefmt-check> 193 | return " ".join(parts).encode("utf-8") treefmt-check> 194 | treefmt-check> 195 | def _write_command(self, command: str, args: list[str] = []) -> None: treefmt-check> | ^^ treefmt-check> 196 | self.sendLine(self._create_command(command, args)) treefmt-check> | treefmt-check> help: Replace with `None`; initialize within function treefmt-check> treefmt-check> Found 298 errors (242 fixed, 56 remaining). treefmt-check> No fixes available (33 hidden fixes can be enabled with the `--unsafe-fixes` option). treefmt-check> treefmt-check> traversed 45 files treefmt-check> emitted 18 files for processing treefmt-check> formatted 0 files (14 changed) in 145ms treefmt-check> Error: failed to finalise formatting: formatting failures detected error: build of '/nix/store/5aj9vkblzc58d7jss6n8iiqwpcs6lxsa-treefmt-check.drv' on 'ssh-ng://customer@mac02' failed: Cannot build '/nix/store/5aj9vkblzc58d7jss6n8iiqwpcs6lxsa-treefmt-check.drv'. Reason: builder failed with exit code 1. Output paths: /nix/store/pprfyf9nmxzqjiq721bw4vpxkq556q6n-treefmt-check Last 25 log lines: > 178 | def _create_command(self, command: str, args: list[str] = []) -> bytes: > | ^^ > 179 | # XXX: this function should be generalized in future. There exists > 180 | # almost identical code in ``MPDClient._write_command``, with the > | > help: Replace with `None`; initialize within function > > B006 Do not use mutable data structures for argument defaults > --> mpd/twisted.py:195:62 > | > 193 | return " ".join(parts).encode("utf-8") > 194 | > 195 | def _write_command(self, command: str, args: list[str] = []) -> None: > | ^^ > 196 | self.sendLine(self._create_command(command, args)) > | > help: Replace with `None`; initialize within function > > Found 298 errors (242 fixed, 56 remaining). > No fixes available (33 hidden fixes can be enabled with the `--unsafe-fixes` option). > > traversed 45 files > emitted 18 files for processing > formatted 0 files (14 changed) in 145ms > Error: failed to finalise formatting: formatting failures detected For full logs, run: nix log /nix/store/5aj9vkblzc58d7jss6n8iiqwpcs6lxsa-treefmt-check.drv error: Cannot build '/nix/store/5aj9vkblzc58d7jss6n8iiqwpcs6lxsa-treefmt-check.drv'. Reason: builder failed with exit code 1. Output paths: /nix/store/pprfyf9nmxzqjiq721bw4vpxkq556q6n-treefmt-check