treefmt-check
default.checks.aarch64-darwin.treefmt
· build #40
· raw
1treefmt v2.5.0ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 123CPY001 Missing copyright notice at top of file4--> weather-cli/lib/weather_cli/__init__.py:1:156CPY001 Missing copyright notice at top of file7--> weather-cli/lib/weather_cli/main.py:1:189Found 2 errors.1011ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 11213BLE001 Do not catch blind exception: `Exception`14 --> kagi-search/kagi_search.py:199:1615 |16197 | print(stderr_msg, file=sys.stderr)17198 | sys.exit(1)18199 | except Exception as e:19 | ^^^^^^^^^20200 | error_msg = colorize(f"Error getting session token: {e}", color="red", bold=True)21201 | print(error_msg, file=sys.stderr)22 |2324TRY002 Create your own exception25 --> kagi-search/kagi_search.py:218:2326 |27216 | return # Success28217 | elif "/signin" in final_url or "/welcome" in final_url:29218 | raise Exception(f"Authentication failed - redirected to {final_url}")30 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^31219 | except Exception as e:32220 | raise Exception(f"Failed to authenticate with token: {e}")33 |3435BLE001 Do not catch blind exception: `Exception`36 --> kagi-search/kagi_search.py:219:1637 |38217 | elif "/signin" in final_url or "/welcome" in final_url:39218 | raise Exception(f"Authentication failed - redirected to {final_url}")40219 | except Exception as e:41 | ^^^^^^^^^42220 | raise Exception(f"Failed to authenticate with token: {e}")43 |4445TRY002 Create your own exception46 --> kagi-search/kagi_search.py:220:1947 |48218 | raise Exception(f"Authentication failed - redirected to {final_url}")49219 | except Exception as e:50220 | raise Exception(f"Failed to authenticate with token: {e}")51 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^52221 |53222 | def search(self, query: str, limit: int = 10) -> list[SearchResult]:54 |5556TRY002 Create your own exception57 --> kagi-search/kagi_search.py:260:2758 |59258 | final_url = response.geturl()60259 | if "/signin" in final_url or "/welcome" in final_url:61260 | raise Exception(f"Authentication failed - redirected to {final_url}")62 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^63261 |64262 | # Read response65 |6667TRY002 Create your own exception68 --> kagi-search/kagi_search.py:280:2769 |70278 | time.sleep(retry_delay)71279 | continue72280 | raise Exception("No results box found on page")73 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^74281 |75282 | # Extract search results76 |7778TRY004 Prefer `TypeError` exception for invalid type79 --> kagi-search/kagi_search.py:285:2180 |81283 | results = []82284 | if not isinstance(results_box, Tag):83285 | raise Exception("Results box is not a Tag element")84 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^85286 | search_results = results_box.find_all(class_="search-result")86 |8788TRY002 Create your own exception89 --> kagi-search/kagi_search.py:285:2790 |91283 | results = []92284 | if not isinstance(results_box, Tag):93285 | raise Exception("Results box is not a Tag element")94 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^95286 | search_results = results_box.find_all(class_="search-result")96 |9798TRY002 Create your own exception99 --> kagi-search/kagi_search.py:332:23100 |101330 | time.sleep(retry_delay)102331 | continue103332 | raise Exception(f"Request failed: {e}")104 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^105333 |106334 | return []107 |108109TRY002 Create your own exception110 --> kagi-search/kagi_search.py:385:23111 |112383 | logger.debug(f"Final URL: {final_url}")113384 | if "/signin" in final_url or "/welcome" in final_url:114385 | raise Exception(f"Authentication failed - redirected to {final_url}")115 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^116386 |117387 | # Read response118 |119120BLE001 Do not catch blind exception: `Exception`121 --> kagi-search/kagi_search.py:460:16122 |123458 | )124459 |125460 | except Exception as e:126 | ^^^^^^^^^127461 | # Quick Answer might not be available for all queries128462 | logger.debug(f"Quick Answer error: {type(e).__name__}: {e}")129 |130131BLE001 Do not catch blind exception: `Exception`132 --> kagi-search/kagi_search.py:500:12133 |134498 | try:135499 | client = KagiSearch(session_token=args.token, config_path=args.config)136500 | except Exception as e:137 | ^^^^^^^^^138501 | error_msg = colorize(f"Error initializing Kagi client: {e}", color="red", bold=True)139502 | print(error_msg, file=sys.stderr)140 |141142BLE001 Do not catch blind exception: `Exception`143 --> kagi-search/kagi_search.py:509:12144 |145507 | results = client.search(args.query, limit=args.num_results) if args.links else []146508 | quick_answer = client.get_quick_answer(args.query)147509 | except Exception as e:148 | ^^^^^^^^^149510 | error_msg = colorize(f"Search failed: {e}", color="red", bold=True)150511 | print(error_msg, file=sys.stderr)151 |152153Found 28 errors (15 fixed, 13 remaining).154155ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 1156157CPY001 Missing copyright notice at top of file158--> browser-cli/browser_cli/__init__.py:1:1159160CPY001 Missing copyright notice at top of file161--> browser-cli/browser_cli/__main__.py:1:1162163CPY001 Missing copyright notice at top of file164--> browser-cli/browser_cli/bridge.py:1:1165166CPY001 Missing copyright notice at top of file167--> browser-cli/browser_cli/browsh.py:1:1168169CPY001 Missing copyright notice at top of file170--> browser-cli/browser_cli/cli.py:1:1171172CPY001 Missing copyright notice at top of file173--> browser-cli/browser_cli/client.py:1:1174175CPY001 Missing copyright notice at top of file176--> browser-cli/browser_cli/config.py:1:1177178CPY001 Missing copyright notice at top of file179--> browser-cli/browser_cli/errors.py:1:1180181CPY001 Missing copyright notice at top of file182--> browser-cli/browser_cli/paths.py:1:1183184CPY001 Missing copyright notice at top of file185--> browser-cli/browser_cli/server.py:1:1186187Found 10 errors.188189ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 1190191CPY001 Missing copyright notice at top of file192--> pexpect-cli/pexpect_cli/__init__.py:1:1193194CPY001 Missing copyright notice at top of file195--> pexpect-cli/pexpect_cli/client.py:1:1196197CPY001 Missing copyright notice at top of file198--> pexpect-cli/pexpect_cli/server.py:1:1199200CPY001 Missing copyright notice at top of file201--> pexpect-cli/tests/__init__.py:1:1202203CPY001 Missing copyright notice at top of file204--> pexpect-cli/tests/test_integration.py:1:1205206Found 5 errors.207208ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 1209210CPY001 Missing copyright notice at top of file211--> gmaps-cli/gmaps_cli.py:1:1212213CPY001 Missing copyright notice at top of file214--> gmaps-cli/test_gmaps_cli_integration.py:1:1215216Found 5 errors (3 fixed, 2 remaining).217218ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 1219220CPY001 Missing copyright notice at top of file221--> tasker-cli/lib/tasker_cli/__init__.py:1:1222223CPY001 Missing copyright notice at top of file224--> tasker-cli/lib/tasker_cli/adb.py:1:1225226CPY001 Missing copyright notice at top of file227--> tasker-cli/lib/tasker_cli/config.py:1:1228229CPY001 Missing copyright notice at top of file230--> tasker-cli/lib/tasker_cli/main.py:1:1231232CPY001 Missing copyright notice at top of file233--> tasker-cli/lib/tasker_cli/specs.py:1:1234235CPY001 Missing copyright notice at top of file236--> tasker-cli/lib/tasker_cli/webui.py:1:1237238RUF036 `None` not at the end of the type union.239 --> tasker-cli/lib/tasker_cli/webui.py:17:5240 |24115 | # JSON type aliases for the untyped WebUI responses24216 | type JsonValue = (24317 | str | int | float | bool | None | list[JsonValue] | dict[str, JsonValue]244 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^24518 | )246 |247help: Move `None` to the end of the type union248249CPY001 Missing copyright notice at top of file250--> tasker-cli/tests/__init__.py:1:1251252CPY001 Missing copyright notice at top of file253--> tasker-cli/tests/conftest.py:1:1254255CPY001 Missing copyright notice at top of file256--> tasker-cli/tests/test_deploy.py:1:1257258CPY001 Missing copyright notice at top of file259--> tasker-cli/tests/test_specs.py:1:1260261Found 11 errors.262No fixes available (1 hidden fix can be enabled with the `--unsafe-fixes` option).263264ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 1265266EXE001 Shebang is present but file is not executable267 --> screenshot-cli/screenshot_cli.py:1:1268 |2691 | #!/usr/bin/env python3270 | ^^^^^^^^^^^^^^^^^^^^^^2712 | """Non-interactive screenshot CLI for agent use on macOS and Linux Wayland.272 |273274DTZ005 `datetime.datetime.now()` called without a `tz` argument275 --> screenshot-cli/screenshot_cli.py:261:14276 |277259 | # Include microseconds: niri actions complete in ~150ms so two calls278260 | # easily land in the same wall-clock second and clobber each other.279261 | ts = datetime.now().strftime("%Y%m%d-%H%M%S-%f")280 | ^^^^^^^^^^^^^^281262 | output = str(outdir / f"screenshot-{ts}.png")282263 | Path(output).parent.mkdir(parents=True, exist_ok=True)283 |284help: Pass a `datetime.timezone` object to the `tz` parameter285286Found 3 errors (1 fixed, 2 remaining).287288ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 1289290CPY001 Missing copyright notice at top of file291--> calendar-cli/calendar_cli/__init__.py:1:1292293CPY001 Missing copyright notice at top of file294--> calendar-cli/calendar_cli/cache.py:1:1295296CPY001 Missing copyright notice at top of file297--> calendar-cli/calendar_cli/config.py:1:1298299CPY001 Missing copyright notice at top of file300--> calendar-cli/calendar_cli/create.py:1:1301302CPY001 Missing copyright notice at top of file303--> calendar-cli/calendar_cli/email_invite.py:1:1304305CPY001 Missing copyright notice at top of file306--> calendar-cli/calendar_cli/errors.py:1:1307308CPY001 Missing copyright notice at top of file309--> calendar-cli/calendar_cli/import_invite.py:1:1310311CPY001 Missing copyright notice at top of file312--> calendar-cli/calendar_cli/main.py:1:1313314CPY001 Missing copyright notice at top of file315--> calendar-cli/calendar_cli/models.py:1:1316317CPY001 Missing copyright notice at top of file318--> calendar-cli/calendar_cli/parse.py:1:1319320CPY001 Missing copyright notice at top of file321--> calendar-cli/calendar_cli/reply.py:1:1322323CPY001 Missing copyright notice at top of file324--> calendar-cli/calendar_cli/store.py:1:1325326CPY001 Missing copyright notice at top of file327--> calendar-cli/calendar_cli/timeutil.py:1:1328329CPY001 Missing copyright notice at top of file330--> calendar-cli/calendar_cli/util.py:1:1331332CPY001 Missing copyright notice at top of file333--> calendar-cli/tests/__init__.py:1:1334335CPY001 Missing copyright notice at top of file336--> calendar-cli/tests/conftest.py:1:1337338CPY001 Missing copyright notice at top of file339--> calendar-cli/tests/helpers.py:1:1340341CPY001 Missing copyright notice at top of file342--> calendar-cli/tests/test_cache.py:1:1343344CPY001 Missing copyright notice at top of file345--> calendar-cli/tests/test_cli.py:1:1346347CPY001 Missing copyright notice at top of file348--> calendar-cli/tests/test_import.py:1:1349350CPY001 Missing copyright notice at top of file351--> calendar-cli/tests/test_invite.py:1:1352353CPY001 Missing copyright notice at top of file354--> calendar-cli/tests/test_reply.py:1:1355356CPY001 Missing copyright notice at top of file357--> calendar-cli/tests/test_store.py:1:1358359Found 23 errors.360361ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 1362363SIM102 Use a single `if` statement instead of nested `if` statements364 --> n8n-cli/n8n_cli/commands/apply.py:64:13365 |36663 | # Filter by IDs if specified36764 | / if ids:36865 | | if not wf_id or wf_id not in ids:369 | |_________________________________________________^37066 | continue371 |372help: Combine `if` statements using `and`373374SIM103 Return the condition `local.get("active") != remote.get("active")` directly375 --> n8n-cli/n8n_cli/commands/apply.py:137:5376 |377135 | return True378136 | # Compare active state379137 | / if local.get("active") != remote.get("active"):380138 | | return True381139 | | return False382 | |________________^383help: Replace with `return local.get("active") != remote.get("active")`384385SIM102 Use a single `if` statement instead of nested `if` statements386 --> n8n-cli/n8n_cli/commands/apply.py:224:9387 |388222 | local_updated = data.get("updatedAt")389223 | remote_updated = remote.get("updatedAt")390224 | / if local_updated and remote_updated and remote_updated > local_updated:391225 | | if not ns.force:392 | |____________________________^393226 | print(394227 | f" conflict: {basename} (remote is newer: {remote_updated} > {local_updated})"395 |396help: Combine `if` statements using `and`397398SIM117 Use a single `with` statement with multiple contexts instead of nested `with` statements399 --> n8n-cli/tests/test_errors.py:14:9400 |40112 | """Missing API URL/key produces a ConfigError, not a traceback."""40213 | env = {"N8N_API_URL": "", "N8N_API_KEY": ""}40314 | / with patch.dict("os.environ", env, clear=False):40415 | | with patch("sys.argv", ["n8n-cli", "credential", "list"]):405 | |______________________________________________________________________^40616 | with pytest.raises(SystemExit) as exc_info:40717 | main()408 |409help: Combine `with` statements410411SIM117 Use a single `with` statement with multiple contexts instead of nested `with` statements412 --> n8n-cli/tests/test_errors.py:24:9413 |41422 | def test_unknown_command(self, capsys: pytest.CaptureFixture[str]) -> None:41523 | """Unknown top-level command exits with code 2 (argparse error)."""41624 | / with patch.dict("os.environ", {"N8N_API_URL": "x", "N8N_API_KEY": "x"}):41725 | | with patch("sys.argv", ["n8n-cli", "bogus"]):418 | |_________________________________________________________^41926 | with pytest.raises(SystemExit) as exc_info:42027 | main()421 |422help: Combine `with` statements423424Found 16 errors (11 fixed, 5 remaining).425No fixes available (2 hidden fixes can be enabled with the `--unsafe-fixes` option).426427traversed 188 files428emitted 166 files for processing429formatted 81 files (8 changed) in 2.339s430Error: failed to finalise formatting: formatting failures detected