treefmt v2.5.0ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 1 EXE001 Shebang is present but file is not executable --> modules/biodb/scripts/biodb-helper.py:1:1 | 1 | #!/usr/bin/env python3 | ^^^^^^^^^^^^^^^^^^^^^^ 2 | """Small state/publish helper for biodb shell recipes.""" | EXE001 Shebang is present but file is not executable --> modules/monitoring/audit/ssh-access.py:1:1 | 1 | #!/usr/bin/env python3 | ^^^^^^^^^^^^^^^^^^^^^^ 2 | from __future__ import annotations | TRY004 Prefer `TypeError` exception for invalid type --> modules/monitoring/audit/ssh-access.py:121:9 | 119 | end_ip = ip_address(end) 120 | if not isinstance(start_ip, IPv4Address) or not isinstance(end_ip, IPv4Address): 121 | raise ValueError(f"only IPv4 emergency ranges are supported: {raw_range}") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 122 | return EmergencyRange(start_ip, end_ip) | EXE001 Shebang is present but file is not executable --> modules/monitoring/audit/tailnet-app-access.py:1:1 | 1 | #!/usr/bin/env python3 | ^^^^^^^^^^^^^^^^^^^^^^ 2 | from __future__ import annotations | EXE001 Shebang is present but file is not executable --> modules/monitoring/exporters/systemd-status.py:1:1 | 1 | #!/usr/bin/env python3 | ^^^^^^^^^^^^^^^^^^^^^^ 2 | import argparse 3 | import json | EXE001 Shebang is present but file is not executable --> modules/stalwart/principals/ensure_principals.py:1:1 | 1 | #!/usr/bin/env python3 | ^^^^^^^^^^^^^^^^^^^^^^ 2 | import argparse 3 | import base64 | EXE001 Shebang is present but file is not executable --> tasks.py:1:1 | 1 | #!/usr/bin/env python3 | ^^^^^^^^^^^^^^^^^^^^^^ 2 | 3 | import json | SIM102 Use a single `if` statement instead of nested `if` statements --> tasks.py:73:9 | 72 | for i, line in enumerate(lines): 73 | / if "Syncing keys for file" in line: 74 | | if i + 1 >= len(lines) or "already up to date" not in lines[i + 1]: | |_______________________________________________________________________________^ 75 | filename = line.split("file ")[-1] 76 | updated_files.append(filename) | help: Combine `if` statements using `and` BLE001 Do not catch blind exception: `Exception` --> tasks.py:415:12 | 413 | print(f"Magic packet sent to {host}!") 414 | 415 | except Exception as e: | ^^^^^^^^^ 416 | print(f"Error: {e}") 417 | if "nixosConfigurations" in str(e): | PLR1722 Use `sys.exit()` instead of `exit` --> tasks.py:525:9 | 523 | if keys["machines"].get(hostname, None): 524 | print("Configuration already exists") 525 | exit(-1) | ^^^^ 526 | keys["machines"][hostname] = "" 527 | with open(f"{ROOT}/pubkeys.json", "w") as f: | help: Replace `exit` with `sys.exit()` DTZ005 `datetime.datetime.now()` called without a `tz` argument --> tasks.py:620:13 | 618 | expired = [] 619 | expiring = [] 620 | today = datetime.now().date() | ^^^^^^^^^^^^^^ 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 839ms Error: failed to finalise formatting: formatting failures detected