treefmt-check
default.checks.aarch64-darwin.treefmt
· build #39
· 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 1190191EXE001 Shebang is present but file is not executable192 --> screenshot-cli/screenshot_cli.py:1:1193 |1941 | #!/usr/bin/env python3195 | ^^^^^^^^^^^^^^^^^^^^^^1962 | """Non-interactive screenshot CLI for agent use on macOS and Linux Wayland.197 |198199DTZ005 `datetime.datetime.now()` called without a `tz` argument200 --> screenshot-cli/screenshot_cli.py:261:14201 |202259 | # Include microseconds: niri actions complete in ~150ms so two calls203260 | # easily land in the same wall-clock second and clobber each other.204261 | ts = datetime.now().strftime("%Y%m%d-%H%M%S-%f")205 | ^^^^^^^^^^^^^^206262 | output = str(outdir / f"screenshot-{ts}.png")207263 | Path(output).parent.mkdir(parents=True, exist_ok=True)208 |209help: Pass a `datetime.timezone` object to the `tz` parameter210211Found 3 errors (1 fixed, 2 remaining).212213ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 1214215CPY001 Missing copyright notice at top of file216--> pexpect-cli/pexpect_cli/__init__.py:1:1217218CPY001 Missing copyright notice at top of file219--> pexpect-cli/pexpect_cli/client.py:1:1220221CPY001 Missing copyright notice at top of file222--> pexpect-cli/pexpect_cli/server.py:1:1223224CPY001 Missing copyright notice at top of file225--> pexpect-cli/tests/__init__.py:1:1226227CPY001 Missing copyright notice at top of file228--> pexpect-cli/tests/test_integration.py:1:1229230Found 5 errors.231232ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 1233234CPY001 Missing copyright notice at top of file235--> gmaps-cli/gmaps_cli.py:1:1236237CPY001 Missing copyright notice at top of file238--> gmaps-cli/test_gmaps_cli_integration.py:1:1239240Found 5 errors (3 fixed, 2 remaining).241242ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 1243244CPY001 Missing copyright notice at top of file245--> tasker-cli/lib/tasker_cli/__init__.py:1:1246247CPY001 Missing copyright notice at top of file248--> tasker-cli/lib/tasker_cli/adb.py:1:1249250CPY001 Missing copyright notice at top of file251--> tasker-cli/lib/tasker_cli/config.py:1:1252253CPY001 Missing copyright notice at top of file254--> tasker-cli/lib/tasker_cli/main.py:1:1255256CPY001 Missing copyright notice at top of file257--> tasker-cli/lib/tasker_cli/specs.py:1:1258259CPY001 Missing copyright notice at top of file260--> tasker-cli/lib/tasker_cli/webui.py:1:1261262RUF036 `None` not at the end of the type union.263 --> tasker-cli/lib/tasker_cli/webui.py:17:5264 |26515 | # JSON type aliases for the untyped WebUI responses26616 | type JsonValue = (26717 | str | int | float | bool | None | list[JsonValue] | dict[str, JsonValue]268 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^26918 | )270 |271help: Move `None` to the end of the type union272273CPY001 Missing copyright notice at top of file274--> tasker-cli/tests/__init__.py:1:1275276CPY001 Missing copyright notice at top of file277--> tasker-cli/tests/conftest.py:1:1278279CPY001 Missing copyright notice at top of file280--> tasker-cli/tests/test_deploy.py:1:1281282CPY001 Missing copyright notice at top of file283--> tasker-cli/tests/test_specs.py:1:1284285Found 11 errors.286No fixes available (1 hidden fix can be enabled with the `--unsafe-fixes` option).287288ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 1289290SIM102 Use a single `if` statement instead of nested `if` statements291 --> n8n-cli/n8n_cli/commands/apply.py:64:13292 |29363 | # Filter by IDs if specified29464 | / if ids:29565 | | if not wf_id or wf_id not in ids:296 | |_________________________________________________^29766 | continue298 |299help: Combine `if` statements using `and`300301SIM103 Return the condition `local.get("active") != remote.get("active")` directly302 --> n8n-cli/n8n_cli/commands/apply.py:137:5303 |304135 | return True305136 | # Compare active state306137 | / if local.get("active") != remote.get("active"):307138 | | return True308139 | | return False309 | |________________^310help: Replace with `return local.get("active") != remote.get("active")`311312SIM102 Use a single `if` statement instead of nested `if` statements313 --> n8n-cli/n8n_cli/commands/apply.py:224:9314 |315222 | local_updated = data.get("updatedAt")316223 | remote_updated = remote.get("updatedAt")317224 | / if local_updated and remote_updated and remote_updated > local_updated:318225 | | if not ns.force:319 | |____________________________^320226 | print(321227 | f" conflict: {basename} (remote is newer: {remote_updated} > {local_updated})"322 |323help: Combine `if` statements using `and`324325SIM117 Use a single `with` statement with multiple contexts instead of nested `with` statements326 --> n8n-cli/tests/test_errors.py:14:9327 |32812 | """Missing API URL/key produces a ConfigError, not a traceback."""32913 | env = {"N8N_API_URL": "", "N8N_API_KEY": ""}33014 | / with patch.dict("os.environ", env, clear=False):33115 | | with patch("sys.argv", ["n8n-cli", "credential", "list"]):332 | |______________________________________________________________________^33316 | with pytest.raises(SystemExit) as exc_info:33417 | main()335 |336help: Combine `with` statements337338SIM117 Use a single `with` statement with multiple contexts instead of nested `with` statements339 --> n8n-cli/tests/test_errors.py:24:9340 |34122 | def test_unknown_command(self, capsys: pytest.CaptureFixture[str]) -> None:34223 | """Unknown top-level command exits with code 2 (argparse error)."""34324 | / with patch.dict("os.environ", {"N8N_API_URL": "x", "N8N_API_KEY": "x"}):34425 | | with patch("sys.argv", ["n8n-cli", "bogus"]):345 | |_________________________________________________________^34626 | with pytest.raises(SystemExit) as exc_info:34727 | main()348 |349help: Combine `with` statements350351Found 16 errors (11 fixed, 5 remaining).352No fixes available (2 hidden fixes can be enabled with the `--unsafe-fixes` option).353354ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 1355356CPY001 Missing copyright notice at top of file357--> calendar-cli/calendar_cli/__init__.py:1:1358359CPY001 Missing copyright notice at top of file360--> calendar-cli/calendar_cli/cache.py:1:1361362CPY001 Missing copyright notice at top of file363--> calendar-cli/calendar_cli/config.py:1:1364365CPY001 Missing copyright notice at top of file366--> calendar-cli/calendar_cli/create.py:1:1367368CPY001 Missing copyright notice at top of file369--> calendar-cli/calendar_cli/email_invite.py:1:1370371CPY001 Missing copyright notice at top of file372--> calendar-cli/calendar_cli/errors.py:1:1373374CPY001 Missing copyright notice at top of file375--> calendar-cli/calendar_cli/import_invite.py:1:1376377CPY001 Missing copyright notice at top of file378--> calendar-cli/calendar_cli/main.py:1:1379380CPY001 Missing copyright notice at top of file381--> calendar-cli/calendar_cli/models.py:1:1382383CPY001 Missing copyright notice at top of file384--> calendar-cli/calendar_cli/parse.py:1:1385386CPY001 Missing copyright notice at top of file387--> calendar-cli/calendar_cli/reply.py:1:1388389CPY001 Missing copyright notice at top of file390--> calendar-cli/calendar_cli/store.py:1:1391392CPY001 Missing copyright notice at top of file393--> calendar-cli/calendar_cli/timeutil.py:1:1394395CPY001 Missing copyright notice at top of file396--> calendar-cli/calendar_cli/util.py:1:1397398CPY001 Missing copyright notice at top of file399--> calendar-cli/tests/__init__.py:1:1400401CPY001 Missing copyright notice at top of file402--> calendar-cli/tests/conftest.py:1:1403404CPY001 Missing copyright notice at top of file405--> calendar-cli/tests/helpers.py:1:1406407CPY001 Missing copyright notice at top of file408--> calendar-cli/tests/test_cache.py:1:1409410CPY001 Missing copyright notice at top of file411--> calendar-cli/tests/test_cli.py:1:1412413CPY001 Missing copyright notice at top of file414--> calendar-cli/tests/test_import.py:1:1415416CPY001 Missing copyright notice at top of file417--> calendar-cli/tests/test_invite.py:1:1418419CPY001 Missing copyright notice at top of file420--> calendar-cli/tests/test_reply.py:1:1421422CPY001 Missing copyright notice at top of file423--> calendar-cli/tests/test_store.py:1:1424425Found 23 errors.426427traversed 188 files428emitted 166 files for processing429formatted 81 files (8 changed) in 4.493s430Error: failed to finalise formatting: formatting failures detected