treefmt-check
checks.x86_64-linux.treefmt
· build #187
· raw
1build-x86-01: building l8ipd4fqx14ji4xgq53kc08dabb4nd0i-treefmt-check.drv2treefmt v2.6.0ERRO formatter | ruff-check: failed to apply with options '[check --fix checks/hermes-desktop-connections/test.py checks/hermes-remote-probe.py checks/hermes-simplex-address-retry/fake_simplex.py checks/spaces-install-secret-dialog/driver.py checks/spaces-integration-approval-vm/actor.py checks/spaces-integration-confirm/driver.py checks/spaces-integration-gateway-e2e/driver.py checks/spaces-integration-proton-tls/gen.py checks/spaces-integration-proton-tls/stub.py checks/spaces-integration-wrapper-shell/stub.py checks/spaces-integrations-app-bridge/driver.py checks/spaces-integrations-app-bridge/fake_broker.py checks/spaces-integrations-app-form/driver.py checks/spaces-integrations-app-form/fake_broker.py checks/spaces-integrations-app-managed/driver.py checks/spaces-integrations-app-managed/fake_broker.py checks/spaces-integrations-app-ndjson-socket/driver.py checks/spaces-integrations-app-overview/driver.py checks/spaces-integrations-app-overview/fake_broker.py checks/spaces-integrations-app-setup/driver.py checks/spaces-integrations-app-setup/fake_broker.py checks/spaces-nixos-apply-vm/actor.py checks/spaces-voice-indicator-bar-geometry/driver.py checks/spaces-voice-indicator-plugin-state/driver.py checks/spaces-voice-indicator-state/test_states.py checks/spaces-voice-indicator-warning/driver.py lib/qmllint-gen-qmldir.py lib/qmllint-patch-qmltypes.py lib/qs_broker.py lib/qs_harness.py lib/qs_integrations.py lib/spaces_install_lib.py modules/nixos/hermes/desktop-connections.py modules/nixos/hermes/nix-store-binds.py modules/nixos/hermes/simplex-address.py packages/agent-vm/qmp.py packages/docs-render/docs_render.py packages/docs-render/test_render.py packages/integration-caldav/integration_caldav.py packages/integration-caldav/test_integration_caldav.py packages/integration-contacts/integration_contacts.py packages/integration-contacts/test_integration_contacts.py packages/integration-github/integration_github.py packages/integration-github/test_integration_github.py packages/integration-location/integration_location.py packages/integration-location/test_integration_location.py packages/integration-mail/integration_mail.py packages/integration-mail/test_integration_mail.py packages/integration-nixos/integration_nixos.py packages/integration-nixos/test_integration_nixos.py packages/integration-offline-wiki/integration_offline_wiki.py packages/integration-offline-wiki/test_integration_offline_wiki.py packages/integration-proton/conftest.py packages/integration-proton/integration_proton.py packages/integration-proton/integration_proton_setup.py packages/integration-proton/test_integration_proton.py packages/integration-proton/test_integration_proton_setup.py packages/integration-signal/integration_signal.py packages/integration-signal/integration_signal_setup.py packages/integration-signal/test_integration_signal.py packages/integration-signal/test_integration_signal_setup.py packages/osm-cli/osm_cli.py packages/osm-cli/test_osm_cli.py packages/signal-cli/spaces_signal/__init__.py packages/signal-cli/spaces_signal/bridge.py packages/signal-cli/spaces_signal/db.py packages/signal-cli/spaces_signal/jsonrpc.py packages/signal-cli/test_bridge.py packages/signal-cli/test_db.py packages/simplex-phone/phone.py packages/skill-config/skill_config.py packages/skill-config/skill_store.py packages/skill-config/test_skill_config.py packages/skill-config/test_skill_config_api.py packages/skill-config/test_skill_store.py packages/spaces-himalaya-core/spaces_himalaya_core.py packages/spaces-himalaya-core/test_himalaya_core.py packages/spaces-install-backend/backend.py packages/spaces-install-backend/test_backend.py packages/spaces-install-console/test_vt_palette.py packages/spaces-install-console/vt_palette.py packages/spaces-installer-session/bootstrap.py packages/spaces-installer-session/test_bootstrap.py packages/spaces-integration-mcp/spaces_integration_mcp.py packages/spaces-integration-mcp/test_scaffold.py packages/spaces-restore/conftest.py packages/spaces-restore/spaces_restore/__init__.py packages/spaces-restore/spaces_restore/cli.py packages/spaces-restore/spaces_restore/config.py packages/spaces-restore/spaces_restore/crypto.py packages/spaces-restore/spaces_restore/discovery.py packages/spaces-restore/spaces_restore/manifest.py packages/spaces-restore/spaces_restore/nostr.py packages/spaces-restore/spaces_restore/record.py packages/spaces-restore/spaces_restore/secp.py packages/spaces-restore/spaces_restore/transport.py packages/spaces-restore/test_config.py packages/spaces-restore/test_crypto.py packages/spaces-restore/test_discovery.py packages/spaces-restore/test_generate.py packages/spaces-restore/test_keys.py packages/spaces-restore/test_manifest.py packages/spaces-restore/test_nostr.py packages/spaces-restore/test_nostr_integration.py packages/spaces-restore/test_record.py packages/spaces-restore/test_secp.py packages/spaces-restore/test_transport.py packages/spaces-voice-indicator/spaces_voice_indicator/indicator.py packages/spaces-voice-indicator/spaces_voice_indicator/states.py packages/voxtype-tuner/tests/conftest.py packages/voxtype-tuner/tests/test_app.py packages/voxtype-tuner/tests/test_apply.py packages/voxtype-tuner/tests/test_build_argv.py packages/voxtype-tuner/tests/test_defaults.py packages/voxtype-tuner/tests/test_devices.py packages/voxtype-tuner/tests/test_lifecycle.py packages/voxtype-tuner/tests/test_meter.py packages/voxtype-tuner/tests/test_metrics.py packages/voxtype-tuner/tests/test_models.py packages/voxtype-tuner/tests/test_player.py packages/voxtype-tuner/tests/test_recorder.py packages/voxtype-tuner/tests/test_slots.py packages/voxtype-tuner/tests/test_stderr_guard.py packages/voxtype-tuner/tests/test_streaming.py packages/voxtype-tuner/tests/test_tooltips.py packages/voxtype-tuner/tests/test_transcribe.py packages/voxtype-tuner/tests/test_waveform.py packages/voxtype-tuner/tests/test_wiring.py packages/voxtype-tuner/voxtype_tuner/__init__.py packages/voxtype-tuner/voxtype_tuner/app.py packages/voxtype-tuner/voxtype_tuner/apply.py packages/voxtype-tuner/voxtype_tuner/clipboard.py packages/voxtype-tuner/voxtype_tuner/defaults.py packages/voxtype-tuner/voxtype_tuner/devices.py packages/voxtype-tuner/voxtype_tuner/lifecycle.py packages/voxtype-tuner/voxtype_tuner/meter.py packages/voxtype-tuner/voxtype_tuner/metrics.py packages/voxtype-tuner/voxtype_tuner/models.py packages/voxtype-tuner/voxtype_tuner/params.py packages/voxtype-tuner/voxtype_tuner/player.py packages/voxtype-tuner/voxtype_tuner/recorder.py packages/voxtype-tuner/voxtype_tuner/slots.py packages/voxtype-tuner/voxtype_tuner/stderr_guard.py packages/voxtype-tuner/voxtype_tuner/streaming.py packages/voxtype-tuner/voxtype_tuner/transcribe.py packages/voxtype-tuner/voxtype_tuner/waveform.py packages/voxtype-tuner/voxtype_tuner/wiring.py packages/wikidata-cli/test_wikidata_cli.py packages/wikidata-cli/wikidata_cli.py packages/wikipedia-cli/test_wikipedia_cli.py packages/wikipedia-cli/wikipedia_cli.py]': exit status 134S107 Possible hardcoded password assigned to function default: "token"5 --> checks/hermes-desktop-connections/test.py:21:306 |721 | def run(script, *args, token="tok-1"):8 | ^^^^^^^922 | return subprocess.run(1023 | [script, "--url", URL, *args],11 |1213SIM112 Use capitalized environment variable `WITHREMOTES` instead of `withRemotes`14 --> checks/hermes-desktop-connections/test.py:49:2715 |1649 | with_remotes = os.environ["withRemotes"]17 | ^^^^^^^^^^^^^1850 | office_only = os.environ["officeOnly"]1951 | enforcing = os.environ["enforcing"]20 |21help: Replace `withRemotes` with `WITHREMOTES`2223SIM112 Use capitalized environment variable `OFFICEONLY` instead of `officeOnly`24 --> checks/hermes-desktop-connections/test.py:50:2625 |2649 | with_remotes = os.environ["withRemotes"]2750 | office_only = os.environ["officeOnly"]28 | ^^^^^^^^^^^^2951 | enforcing = os.environ["enforcing"]30 |31help: Replace `officeOnly` with `OFFICEONLY`3233SIM112 Use capitalized environment variable `ENFORCING` instead of `enforcing`34 --> checks/hermes-desktop-connections/test.py:51:2435 |3649 | with_remotes = os.environ["withRemotes"]3750 | office_only = os.environ["officeOnly"]3851 | enforcing = os.environ["enforcing"]39 | ^^^^^^^^^^^4052 |4153 | # Fresh render.42 |43help: Replace `enforcing` with `ENFORCING`4445S106 Possible hardcoded password assigned to argument: "token"46 --> checks/hermes-desktop-connections/test.py:108:1847 |48107 | # A token change reaches both files on the next launch.49108 | run(office_only, token="tok-2")50 | ^^^^^^^^^^^^^51109 | check(load(CONNECTION)["remote"]["token"]["value"] == "tok-2", "connection.json follows the token")52110 | check(load(REGISTRY)["connections"][1]["token"]["value"] == "tok-2", "registry follows the token")53 |5455S106 Possible hardcoded password assigned to argument: "token"56 --> checks/hermes-desktop-connections/test.py:114:2257 |58112 | # connection.json saved in the app stays, and the launcher says so.59113 | CONNECTION.write_text(json.dumps({"mode": "local", "profiles": {}}))60114 | r = run(office_only, token="tok-2")61 | ^^^^^^^^^^^^^62115 | check(load(CONNECTION)["mode"] == "local", "user gateway left alone")63116 | check(str(CONNECTION) in r.stderr and "--reset-connections" in r.stderr, f"stderr names the file: {r.stderr!r}")64 |6566S106 Possible hardcoded password assigned to argument: "token"67 --> checks/hermes-desktop-connections/test.py:120:2968 |69119 | # --reset restores it; the user's registry entry survives the reset.70120 | run(office_only, "--reset", token="tok-2")71 | ^^^^^^^^^^^^^72121 | check(load(CONNECTION)["mode"] == "remote", "reset restores the managed gateway")73122 | check("mine" in ids(load(REGISTRY)), "user entry survives reset")74 |7576S106 Possible hardcoded password assigned to argument: "token"77 --> checks/hermes-desktop-connections/test.py:126:2078 |79124 | # enforcePrimary overwrites a user gateway without a reset.80125 | CONNECTION.write_text(json.dumps({"mode": "local", "profiles": {}}))81126 | r = run(enforcing, token="tok-2")82 | ^^^^^^^^^^^^^83127 | check(load(CONNECTION)["remote"]["url"] == URL and r.stderr == "", "enforcePrimary overwrites")84 |8586S106 Possible hardcoded password assigned to argument: "token"87 --> checks/hermes-desktop-connections/test.py:132:1888 |89130 | SIDECAR.unlink()90131 | CONNECTION.write_text(json.dumps({"mode": "local", "profiles": {}}))91132 | run(office_only, token="tok-2")92 | ^^^^^^^^^^^^^93133 | check(load(CONNECTION)["mode"] == "remote", "first adoption takes over a stray connection.json")94 |9596S106 Possible hardcoded password assigned to argument: "token"97 --> checks/hermes-desktop-connections/test.py:140:1898 |99138 | REGISTRY.unlink()100139 | REGISTRY.symlink_to(target)101140 | run(office_only, token="tok-2")102 | ^^^^^^^^^^^^^103141 | check(not REGISTRY.is_symlink() and REGISTRY.is_file() and mode(REGISTRY) == 0o600, "symlink replaced by a regular file")104142 | check(load(target)["connections"] == [], "symlink target untouched")105 |106107S106 Possible hardcoded password assigned to argument: "token"108 --> checks/hermes-desktop-connections/test.py:146:18109 |110144 | # Garbage in the registry is not fatal.111145 | REGISTRY.write_text("{not json")112146 | run(office_only, token="tok-2")113 | ^^^^^^^^^^^^^114147 | check(ids(load(REGISTRY)) == ["local", "nix-this-machine", "nix-office"], "unparsable registry is rebuilt")115 |116117ANN201 Missing return type annotation for public function `warn`118 --> modules/nixos/hermes/desktop-connections.py:48:5119 |12048 | def warn(msg):121 | ^^^^12249 | print(f"hermes-desktop-connections: {msg}", file=sys.stderr)123 |124help: Add return type annotation: `None`125126ANN001 Missing type annotation for function argument `msg`127 --> modules/nixos/hermes/desktop-connections.py:48:10128 |12948 | def warn(msg):130 | ^^^13149 | print(f"hermes-desktop-connections: {msg}", file=sys.stderr)132 |133134ANN201 Missing return type annotation for public function `load_json`135 --> modules/nixos/hermes/desktop-connections.py:52:5136 |13752 | def load_json(path):138 | ^^^^^^^^^13953 | try:14054 | with open(path, encoding="utf-8") as f:141 |142help: Add return type annotation143144ANN001 Missing type annotation for function argument `path`145 --> modules/nixos/hermes/desktop-connections.py:52:15146 |14752 | def load_json(path):148 | ^^^^14953 | try:15054 | with open(path, encoding="utf-8") as f:151 |152153PTH123 `open()` should be replaced by `Path.open()`154 --> modules/nixos/hermes/desktop-connections.py:54:14155 |15652 | def load_json(path):15753 | try:15854 | with open(path, encoding="utf-8") as f:159 | ^^^^16055 | return json.load(f)16156 | except (OSError, ValueError):162 |163help: Replace with `Path.open()`164165ANN201 Missing return type annotation for public function `read_bytes`166 --> modules/nixos/hermes/desktop-connections.py:60:5167 |16860 | def read_bytes(path):169 | ^^^^^^^^^^17061 | try:17162 | with open(path, "rb") as f:172 |173help: Add return type annotation174175ANN001 Missing type annotation for function argument `path`176 --> modules/nixos/hermes/desktop-connections.py:60:16177 |17860 | def read_bytes(path):179 | ^^^^18061 | try:18162 | with open(path, "rb") as f:182 |183184PTH123 `open()` should be replaced by `Path.open()`185 --> modules/nixos/hermes/desktop-connections.py:62:14186 |18760 | def read_bytes(path):18861 | try:18962 | with open(path, "rb") as f:190 | ^^^^19163 | return f.read()19264 | except OSError:193 |194help: Replace with `Path.open()`195196ANN201 Missing return type annotation for public function `render`197 --> modules/nixos/hermes/desktop-connections.py:68:5198 |19968 | def render(value):200 | ^^^^^^20169 | return (json.dumps(value, indent=2) + "\n").encode("utf-8")202 |203help: Add return type annotation204205ANN001 Missing type annotation for function argument `value`206 --> modules/nixos/hermes/desktop-connections.py:68:12207 |20868 | def render(value):209 | ^^^^^21069 | return (json.dumps(value, indent=2) + "\n").encode("utf-8")211 |212213ANN201 Missing return type annotation for public function `sha256`214 --> modules/nixos/hermes/desktop-connections.py:72:5215 |21672 | def sha256(data):217 | ^^^^^^21873 | return hashlib.sha256(data).hexdigest()219 |220help: Add return type annotation221222ANN001 Missing type annotation for function argument `data`223 --> modules/nixos/hermes/desktop-connections.py:72:12224 |22572 | def sha256(data):226 | ^^^^22773 | return hashlib.sha256(data).hexdigest()228 |229230ANN201 Missing return type annotation for public function `write_private`231 --> modules/nixos/hermes/desktop-connections.py:76:5232 |23376 | def write_private(path, data):234 | ^^^^^^^^^^^^^23577 | """Regular file, 0600, replaced atomically. Skips a byte-identical file."""23678 | if not os.path.islink(path) and read_bytes(path) == data:237 |238help: Add return type annotation: `None`239240ANN001 Missing type annotation for function argument `path`241 --> modules/nixos/hermes/desktop-connections.py:76:19242 |24376 | def write_private(path, data):244 | ^^^^24577 | """Regular file, 0600, replaced atomically. Skips a byte-identical file."""24678 | if not os.path.islink(path) and read_bytes(path) == data:247 |248249ANN001 Missing type annotation for function argument `data`250 --> modules/nixos/hermes/desktop-connections.py:76:25251 |25276 | def write_private(path, data):253 | ^^^^25477 | """Regular file, 0600, replaced atomically. Skips a byte-identical file."""25578 | if not os.path.islink(path) and read_bytes(path) == data:256 |257258PTH114 `os.path.islink()` should be replaced by `Path.is_symlink()`259 --> modules/nixos/hermes/desktop-connections.py:78:12260 |26176 | def write_private(path, data):26277 | """Regular file, 0600, replaced atomically. Skips a byte-identical file."""26378 | if not os.path.islink(path) and read_bytes(path) == data:264 | ^^^^^^^^^^^^^^26579 | return26680 | directory = os.path.dirname(path)267 |268help: Replace with `Path(...).is_symlink()`269270PTH120 `os.path.dirname()` should be replaced by `Path.parent`271 --> modules/nixos/hermes/desktop-connections.py:80:17272 |27378 | if not os.path.islink(path) and read_bytes(path) == data:27479 | return27580 | directory = os.path.dirname(path)276 | ^^^^^^^^^^^^^^^27781 | os.makedirs(directory, mode=0o700, exist_ok=True)27882 | if os.path.islink(path):279 |280help: Replace with `Path(...).parent`281282PTH103 `os.makedirs()` should be replaced by `Path.mkdir(parents=True)`283 --> modules/nixos/hermes/desktop-connections.py:81:5284 |28579 | return28680 | directory = os.path.dirname(path)28781 | os.makedirs(directory, mode=0o700, exist_ok=True)288 | ^^^^^^^^^^^28982 | if os.path.islink(path):29083 | os.unlink(path)291 |292help: Replace with `Path(...).mkdir(parents=True)`293294PTH114 `os.path.islink()` should be replaced by `Path.is_symlink()`295 --> modules/nixos/hermes/desktop-connections.py:82:8296 |29780 | directory = os.path.dirname(path)29881 | os.makedirs(directory, mode=0o700, exist_ok=True)29982 | if os.path.islink(path):300 | ^^^^^^^^^^^^^^30183 | os.unlink(path)30284 | fd, tmp = tempfile.mkstemp(dir=directory, prefix=".", suffix=".tmp")303 |304help: Replace with `Path(...).is_symlink()`305306PTH108 `os.unlink()` should be replaced by `Path.unlink()`307 --> modules/nixos/hermes/desktop-connections.py:83:9308 |30981 | os.makedirs(directory, mode=0o700, exist_ok=True)31082 | if os.path.islink(path):31183 | os.unlink(path)312 | ^^^^^^^^^31384 | fd, tmp = tempfile.mkstemp(dir=directory, prefix=".", suffix=".tmp")31485 | try:315 |316help: Replace with `Path(...).unlink()`317318PTH101 `os.chmod()` should be replaced by `Path.chmod()`319 --> modules/nixos/hermes/desktop-connections.py:88:9320 |32186 | with os.fdopen(fd, "wb") as f:32287 | f.write(data)32388 | os.chmod(tmp, 0o600)324 | ^^^^^^^^32589 | os.replace(tmp, path)32690 | except BaseException:327 |328help: Replace with `Path(...).chmod(...)`329330PTH105 `os.replace()` should be replaced by `Path.replace()`331 --> modules/nixos/hermes/desktop-connections.py:89:9332 |33387 | f.write(data)33488 | os.chmod(tmp, 0o600)33589 | os.replace(tmp, path)336 | ^^^^^^^^^^33790 | except BaseException:33891 | os.unlink(tmp)339 |340help: Replace with `Path(...).replace(...)`341342PTH108 `os.unlink()` should be replaced by `Path.unlink()`343 --> modules/nixos/hermes/desktop-connections.py:91:9344 |34589 | os.replace(tmp, path)34690 | except BaseException:34791 | os.unlink(tmp)348 | ^^^^^^^^^34992 | raise350 |351help: Replace with `Path(...).unlink()`352353ANN201 Missing return type annotation for public function `remove`354 --> modules/nixos/hermes/desktop-connections.py:95:5355 |35695 | def remove(path):357 | ^^^^^^35896 | try:35997 | os.unlink(path)360 |361help: Add return type annotation: `None`362363ANN001 Missing type annotation for function argument `path`364 --> modules/nixos/hermes/desktop-connections.py:95:12365 |36695 | def remove(path):367 | ^^^^36896 | try:36997 | os.unlink(path)370 |371372SIM105 Use `contextlib.suppress(FileNotFoundError)` instead of `try`-`except`-`pass`373 --> modules/nixos/hermes/desktop-connections.py:96:5374 |37595 | def remove(path):37696 | / try:37797 | | os.unlink(path)37898 | | except FileNotFoundError:37999 | | pass380 | |____________^381help: Replace `try`-`except`-`pass` with `with contextlib.suppress(FileNotFoundError): ...`382383PTH108 `os.unlink()` should be replaced by `Path.unlink()`384 --> modules/nixos/hermes/desktop-connections.py:97:9385 |38695 | def remove(path):38796 | try:38897 | os.unlink(path)389 | ^^^^^^^^^39098 | except FileNotFoundError:39199 | pass392 |393help: Replace with `Path(...).unlink()`394395ANN201 Missing return type annotation for public function `plain_token`396 --> modules/nixos/hermes/desktop-connections.py:102:5397 |398102 | def plain_token(value):399 | ^^^^^^^^^^^400103 | return {"encoding": "plain", "value": value}401 |402help: Add return type annotation403404ANN001 Missing type annotation for function argument `value`405 --> modules/nixos/hermes/desktop-connections.py:102:17406 |407102 | def plain_token(value):408 | ^^^^^409103 | return {"encoding": "plain", "value": value}410 |411412ANN201 Missing return type annotation for public function `managed_entries`413 --> modules/nixos/hermes/desktop-connections.py:106:5414 |415106 | def managed_entries(spec, url, token):416 | ^^^^^^^^^^^^^^^417107 | entries = [418108 | dict(LOCAL_ENTRY),419 |420help: Add return type annotation421422ANN001 Missing type annotation for function argument `spec`423 --> modules/nixos/hermes/desktop-connections.py:106:21424 |425106 | def managed_entries(spec, url, token):426 | ^^^^427107 | entries = [428108 | dict(LOCAL_ENTRY),429 |430431ANN001 Missing type annotation for function argument `url`432 --> modules/nixos/hermes/desktop-connections.py:106:27433 |434106 | def managed_entries(spec, url, token):435 | ^^^436107 | entries = [437108 | dict(LOCAL_ENTRY),438 |439440ANN001 Missing type annotation for function argument `token`441 --> modules/nixos/hermes/desktop-connections.py:106:32442 |443106 | def managed_entries(spec, url, token):444 | ^^^^^445107 | entries = [446108 | dict(LOCAL_ENTRY),447 |448449PTH123 `open()` should be replaced by `Path.open()`450 --> modules/nixos/hermes/desktop-connections.py:128:26451 |452126 | token_file = remote["tokenFile"]453127 | try:454128 | with open(token_file, encoding="utf-8") as f:455 | ^^^^456129 | value = f.read().strip()457130 | except OSError as e:458 |459help: Replace with `Path.open()`460461ANN201 Missing return type annotation for public function `merge_registry`462 --> modules/nixos/hermes/desktop-connections.py:138:5463 |464138 | def merge_registry(existing, managed, stale_ids):465 | ^^^^^^^^^^^^^^466139 | if not isinstance(existing, dict) or existing.get("version") != 2:467140 | existing = {}468 |469help: Add return type annotation470471ANN001 Missing type annotation for function argument `existing`472 --> modules/nixos/hermes/desktop-connections.py:138:20473 |474138 | def merge_registry(existing, managed, stale_ids):475 | ^^^^^^^^476139 | if not isinstance(existing, dict) or existing.get("version") != 2:477140 | existing = {}478 |479480ANN001 Missing type annotation for function argument `managed`481 --> modules/nixos/hermes/desktop-connections.py:138:30482 |483138 | def merge_registry(existing, managed, stale_ids):484 | ^^^^^^^485139 | if not isinstance(existing, dict) or existing.get("version") != 2:486140 | existing = {}487 |488489ANN001 Missing type annotation for function argument `stale_ids`490 --> modules/nixos/hermes/desktop-connections.py:138:39491 |492138 | def merge_registry(existing, managed, stale_ids):493 | ^^^^^^^^^494139 | if not isinstance(existing, dict) or existing.get("version") != 2:495140 | existing = {}496 |497498PLR2004 Magic value used in comparison, consider replacing `2` with a constant variable499 --> modules/nixos/hermes/desktop-connections.py:139:69500 |501138 | def merge_registry(existing, managed, stale_ids):502139 | if not isinstance(existing, dict) or existing.get("version") != 2:503 | ^504140 | existing = {}505141 | old = existing.get("connections")506 |507508ANN201 Missing return type annotation for public function `main`509 --> modules/nixos/hermes/desktop-connections.py:163:5510 |511163 | def main():512 | ^^^^513164 | parser = argparse.ArgumentParser()514165 | parser.add_argument("--spec", required=True)515 |516help: Add return type annotation: `int`517518PTH123 `open()` should be replaced by `Path.open()`519 --> modules/nixos/hermes/desktop-connections.py:170:10520 |521168 | args = parser.parse_args()522169 |523170 | with open(args.spec, encoding="utf-8") as f:524 | ^^^^525171 | spec = json.load(f)526172 | token = sys.stdin.read().strip()527 |528help: Replace with `Path.open()`529530PTH118 `os.path.join()` should be replaced by `Path` with `/` operator531 --> modules/nixos/hermes/desktop-connections.py:177:56532 |533175 | return 1534176 |535177 | config_home = os.environ.get("XDG_CONFIG_HOME") or os.path.join(os.environ["HOME"], ".config")536 | ^^^^^^^^^^^^537178 | hermes_dir = os.path.join(config_home, "Hermes")538179 | registry_path = os.path.join(hermes_dir, "connections.json")539 |540541PTH118 `os.path.join()` should be replaced by `Path` with `/` operator542 --> modules/nixos/hermes/desktop-connections.py:178:18543 |544177 | config_home = os.environ.get("XDG_CONFIG_HOME") or os.path.join(os.environ["HOME"], ".config")545178 | hermes_dir = os.path.join(config_home, "Hermes")546 | ^^^^^^^^^^^^547179 | registry_path = os.path.join(hermes_dir, "connections.json")548180 | connection_path = os.path.join(hermes_dir, "connection.json")549 |550551PTH118 `os.path.join()` should be replaced by `Path` with `/` operator552 --> modules/nixos/hermes/desktop-connections.py:179:21553 |554177 | config_home = os.environ.get("XDG_CONFIG_HOME") or os.path.join(os.environ["HOME"], ".config")555178 | hermes_dir = os.path.join(config_home, "Hermes")556179 | registry_path = os.path.join(hermes_dir, "connections.json")557 | ^^^^^^^^^^^^558180 | connection_path = os.path.join(hermes_dir, "connection.json")559181 | sidecar_path = os.path.join(hermes_dir, "nix-managed-connections.json")560 |561562PTH118 `os.path.join()` should be replaced by `Path` with `/` operator563 --> modules/nixos/hermes/desktop-connections.py:180:23564 |565178 | hermes_dir = os.path.join(config_home, "Hermes")566179 | registry_path = os.path.join(hermes_dir, "connections.json")567180 | connection_path = os.path.join(hermes_dir, "connection.json")568 | ^^^^^^^^^^^^569181 | sidecar_path = os.path.join(hermes_dir, "nix-managed-connections.json")570 |571572PTH118 `os.path.join()` should be replaced by `Path` with `/` operator573 --> modules/nixos/hermes/desktop-connections.py:181:20574 |575179 | registry_path = os.path.join(hermes_dir, "connections.json")576180 | connection_path = os.path.join(hermes_dir, "connection.json")577181 | sidecar_path = os.path.join(hermes_dir, "nix-managed-connections.json")578 | ^^^^^^^^^^^^579182 |580183 | if args.reset:581 |582583Found 57 errors.584No fixes available (8 hidden fixes can be enabled with the `--unsafe-fixes` option).585586traversed 612 files587emitted 399 files for processing588formatted 248 files (7 changed) in 871ms589Error: failed to finalise formatting: formatting failures detected