this derivation will be built: /nix/store/wqgc23vv9q9zdiqlxp20v5ij211qrdgf-treefmt-check.drv building '/nix/store/wqgc23vv9q9zdiqlxp20v5ij211qrdgf-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> --> modules/biodb/scripts/biodb-helper.py:1:1 treefmt-check> | treefmt-check> 1 | #!/usr/bin/env python3 treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 2 | """Small state/publish helper for biodb shell recipes.""" treefmt-check> | treefmt-check> treefmt-check> EXE001 Shebang is present but file is not executable treefmt-check> --> modules/monitoring/audit/ssh-access.py:1:1 treefmt-check> | treefmt-check> 1 | #!/usr/bin/env python3 treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 2 | from __future__ import annotations treefmt-check> | treefmt-check> treefmt-check> TRY004 Prefer `TypeError` exception for invalid type treefmt-check> --> modules/monitoring/audit/ssh-access.py:121:9 treefmt-check> | treefmt-check> 119 | end_ip = ip_address(end) treefmt-check> 120 | if not isinstance(start_ip, IPv4Address) or not isinstance(end_ip, IPv4Address): treefmt-check> 121 | raise ValueError(f"only IPv4 emergency ranges are supported: {raw_range}") treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 122 | return EmergencyRange(start_ip, end_ip) treefmt-check> | treefmt-check> treefmt-check> EXE001 Shebang is present but file is not executable treefmt-check> --> modules/monitoring/audit/tailnet-app-access.py:1:1 treefmt-check> | treefmt-check> 1 | #!/usr/bin/env python3 treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 2 | from __future__ import annotations treefmt-check> | treefmt-check> treefmt-check> EXE001 Shebang is present but file is not executable treefmt-check> --> modules/monitoring/exporters/systemd-status.py:1:1 treefmt-check> | treefmt-check> 1 | #!/usr/bin/env python3 treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 2 | import argparse treefmt-check> 3 | import json treefmt-check> | treefmt-check> treefmt-check> EXE001 Shebang is present but file is not executable treefmt-check> --> modules/stalwart/principals/ensure_principals.py:1:1 treefmt-check> | treefmt-check> 1 | #!/usr/bin/env python3 treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 2 | import argparse treefmt-check> 3 | import base64 treefmt-check> | treefmt-check> treefmt-check> EXE001 Shebang is present but file is not executable treefmt-check> --> tasks.py:1:1 treefmt-check> | treefmt-check> 1 | #!/usr/bin/env python3 treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 2 | treefmt-check> 3 | import json treefmt-check> | treefmt-check> treefmt-check> SIM102 Use a single `if` statement instead of nested `if` statements treefmt-check> --> tasks.py:73:9 treefmt-check> | treefmt-check> 72 | for i, line in enumerate(lines): treefmt-check> 73 | / if "Syncing keys for file" in line: treefmt-check> 74 | | if i + 1 >= len(lines) or "already up to date" not in lines[i + 1]: treefmt-check> | |_______________________________________________________________________________^ treefmt-check> 75 | filename = line.split("file ")[-1] treefmt-check> 76 | updated_files.append(filename) treefmt-check> | treefmt-check> help: Combine `if` statements using `and` treefmt-check> treefmt-check> BLE001 Do not catch blind exception: `Exception` treefmt-check> --> tasks.py:415:12 treefmt-check> | treefmt-check> 413 | print(f"Magic packet sent to {host}!") treefmt-check> 414 | treefmt-check> 415 | except Exception as e: treefmt-check> | ^^^^^^^^^ treefmt-check> 416 | print(f"Error: {e}") treefmt-check> 417 | if "nixosConfigurations" in str(e): treefmt-check> | treefmt-check> treefmt-check> PLR1722 Use `sys.exit()` instead of `exit` treefmt-check> --> tasks.py:525:9 treefmt-check> | treefmt-check> 523 | if keys["machines"].get(hostname, None): treefmt-check> 524 | print("Configuration already exists") treefmt-check> 525 | exit(-1) treefmt-check> | ^^^^ treefmt-check> 526 | keys["machines"][hostname] = "" treefmt-check> 527 | with open(f"{ROOT}/pubkeys.json", "w") as f: treefmt-check> | treefmt-check> help: Replace `exit` with `sys.exit()` treefmt-check> treefmt-check> DTZ005 `datetime.datetime.now()` called without a `tz` argument treefmt-check> --> tasks.py:620:13 treefmt-check> | treefmt-check> 618 | expired = [] treefmt-check> 619 | expiring = [] treefmt-check> 620 | today = datetime.now().date() treefmt-check> | ^^^^^^^^^^^^^^ treefmt-check> 621 | treefmt-check> 622 | # Find all matches treefmt-check> | treefmt-check> help: Pass a `datetime.timezone` object to the `tz` parameter treefmt-check> treefmt-check> DTZ007 Naive datetime constructed using `datetime.datetime.strptime()` without %z treefmt-check> --> tasks.py:626:24 treefmt-check> | treefmt-check> 624 | username = match.group(1) treefmt-check> 625 | expires_str = match.group(2) treefmt-check> 626 | expires_date = datetime.strptime(expires_str, "%Y-%m-%d").date() treefmt-check> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ treefmt-check> 627 | treefmt-check> 628 | # Skip if this is inside a comment treefmt-check> | treefmt-check> help: Call `.replace(tzinfo=)` or `.astimezone()` to convert to an aware datetime treefmt-check> treefmt-check> Found 19 errors (7 fixed, 12 remaining). treefmt-check> No fixes available (1 hidden fix can be enabled with the `--unsafe-fixes` option). treefmt-check> treefmt-check> traversed 378 files treefmt-check> emitted 343 files for processing treefmt-check> formatted 335 files (4 changed) in 913ms treefmt-check> Error: failed to finalise formatting: formatting failures detected error: Cannot build '/nix/store/wqgc23vv9q9zdiqlxp20v5ij211qrdgf-treefmt-check.drv'. Reason: builder failed with exit code 1. Output paths: /nix/store/j6haq62y3j48j9yppgisgsrypcwx51xp-treefmt-check Last 25 log lines: > | ^^^^^^^^^^^^^^ > 621 | > 622 | # Find all matches > | > help: Pass a `datetime.timezone` object to the `tz` parameter > > DTZ007 Naive datetime constructed using `datetime.datetime.strptime()` without %z > --> tasks.py:626:24 > | > 624 | username = match.group(1) > 625 | expires_str = match.group(2) > 626 | expires_date = datetime.strptime(expires_str, "%Y-%m-%d").date() > | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > 627 | > 628 | # Skip if this is inside a comment > | > help: Call `.replace(tzinfo=)` or `.astimezone()` to convert to an aware datetime > > Found 19 errors (7 fixed, 12 remaining). > No fixes available (1 hidden fix can be enabled with the `--unsafe-fixes` option). > > traversed 378 files > emitted 343 files for processing > formatted 335 files (4 changed) in 913ms > Error: failed to finalise formatting: formatting failures detected For full logs, run: nix log /nix/store/wqgc23vv9q9zdiqlxp20v5ij211qrdgf-treefmt-check.drv