treefmt-check
checks.aarch64-darwin.treefmt
· build #45
· raw
1treefmt v2.6.0ERRO formatter | ruff-check: failed to apply with options '[check --fix weather-cli/lib/weather_cli/__init__.py weather-cli/lib/weather_cli/main.py]': 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 browser-cli/browser_cli/__init__.py browser-cli/browser_cli/__main__.py browser-cli/browser_cli/bridge.py browser-cli/browser_cli/browsh.py browser-cli/browser_cli/cli.py browser-cli/browser_cli/client.py browser-cli/browser_cli/config.py browser-cli/browser_cli/errors.py browser-cli/browser_cli/paths.py browser-cli/browser_cli/server.py]': exit status 11213CPY001 Missing copyright notice at top of file14--> browser-cli/browser_cli/__init__.py:1:11516CPY001 Missing copyright notice at top of file17--> browser-cli/browser_cli/__main__.py:1:11819CPY001 Missing copyright notice at top of file20--> browser-cli/browser_cli/bridge.py:1:12122CPY001 Missing copyright notice at top of file23--> browser-cli/browser_cli/browsh.py:1:12425CPY001 Missing copyright notice at top of file26--> browser-cli/browser_cli/cli.py:1:12728CPY001 Missing copyright notice at top of file29--> browser-cli/browser_cli/client.py:1:13031CPY001 Missing copyright notice at top of file32--> browser-cli/browser_cli/config.py:1:13334CPY001 Missing copyright notice at top of file35--> browser-cli/browser_cli/errors.py:1:13637CPY001 Missing copyright notice at top of file38--> browser-cli/browser_cli/paths.py:1:13940CPY001 Missing copyright notice at top of file41--> browser-cli/browser_cli/server.py:1:14243Found 10 errors.4445ERRO formatter | ruff-check: failed to apply with options '[check --fix kagi-search/kagi_search.py]': exit status 14647BLE001 Do not catch blind exception: `Exception`48 --> kagi-search/kagi_search.py:199:1649 |50197 | print(stderr_msg, file=sys.stderr)51198 | sys.exit(1)52199 | except Exception as e:53 | ^^^^^^^^^54200 | error_msg = colorize(f"Error getting session token: {e}", color="red", bold=True)55201 | print(error_msg, file=sys.stderr)56 |5758TRY002 Create your own exception59 --> kagi-search/kagi_search.py:218:2360 |61216 | return # Success62217 | elif "/signin" in final_url or "/welcome" in final_url:63218 | raise Exception(f"Authentication failed - redirected to {final_url}")64 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^65219 | except Exception as e:66220 | raise Exception(f"Failed to authenticate with token: {e}")67 |6869BLE001 Do not catch blind exception: `Exception`70 --> kagi-search/kagi_search.py:219:1671 |72217 | elif "/signin" in final_url or "/welcome" in final_url:73218 | raise Exception(f"Authentication failed - redirected to {final_url}")74219 | except Exception as e:75 | ^^^^^^^^^76220 | raise Exception(f"Failed to authenticate with token: {e}")77 |7879TRY002 Create your own exception80 --> kagi-search/kagi_search.py:220:1981 |82218 | raise Exception(f"Authentication failed - redirected to {final_url}")83219 | except Exception as e:84220 | raise Exception(f"Failed to authenticate with token: {e}")85 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^86221 |87222 | def search(self, query: str, limit: int = 10) -> list[SearchResult]:88 |8990TRY002 Create your own exception91 --> kagi-search/kagi_search.py:260:2792 |93258 | final_url = response.geturl()94259 | if "/signin" in final_url or "/welcome" in final_url:95260 | raise Exception(f"Authentication failed - redirected to {final_url}")96 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^97261 |98262 | # Read response99 |100101TRY002 Create your own exception102 --> kagi-search/kagi_search.py:280:27103 |104278 | time.sleep(retry_delay)105279 | continue106280 | raise Exception("No results box found on page")107 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^108281 |109282 | # Extract search results110 |111112TRY004 Prefer `TypeError` exception for invalid type113 --> kagi-search/kagi_search.py:285:21114 |115283 | results = []116284 | if not isinstance(results_box, Tag):117285 | raise Exception("Results box is not a Tag element")118 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^119286 | search_results = results_box.find_all(class_="search-result")120 |121122TRY002 Create your own exception123 --> kagi-search/kagi_search.py:285:27124 |125283 | results = []126284 | if not isinstance(results_box, Tag):127285 | raise Exception("Results box is not a Tag element")128 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^129286 | search_results = results_box.find_all(class_="search-result")130 |131132TRY002 Create your own exception133 --> kagi-search/kagi_search.py:332:23134 |135330 | time.sleep(retry_delay)136331 | continue137332 | raise Exception(f"Request failed: {e}")138 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^139333 |140334 | return []141 |142143TRY002 Create your own exception144 --> kagi-search/kagi_search.py:385:23145 |146383 | logger.debug(f"Final URL: {final_url}")147384 | if "/signin" in final_url or "/welcome" in final_url:148385 | raise Exception(f"Authentication failed - redirected to {final_url}")149 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^150386 |151387 | # Read response152 |153154BLE001 Do not catch blind exception: `Exception`155 --> kagi-search/kagi_search.py:460:16156 |157458 | )158459 |159460 | except Exception as e:160 | ^^^^^^^^^161461 | # Quick Answer might not be available for all queries162462 | logger.debug(f"Quick Answer error: {type(e).__name__}: {e}")163 |164165BLE001 Do not catch blind exception: `Exception`166 --> kagi-search/kagi_search.py:500:12167 |168498 | try:169499 | client = KagiSearch(session_token=args.token, config_path=args.config)170500 | except Exception as e:171 | ^^^^^^^^^172501 | error_msg = colorize(f"Error initializing Kagi client: {e}", color="red", bold=True)173502 | print(error_msg, file=sys.stderr)174 |175176BLE001 Do not catch blind exception: `Exception`177 --> kagi-search/kagi_search.py:509:12178 |179507 | results = client.search(args.query, limit=args.num_results) if args.links else []180508 | quick_answer = client.get_quick_answer(args.query)181509 | except Exception as e:182 | ^^^^^^^^^183510 | error_msg = colorize(f"Search failed: {e}", color="red", bold=True)184511 | print(error_msg, file=sys.stderr)185 |186187Found 28 errors (15 fixed, 13 remaining).188189ERRO formatter | ruff-check: failed to apply with options '[check --fix screenshot-cli/screenshot_cli.py screenshot-cli/test_screenshot_cli.py]': 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 pexpect-cli/pexpect_cli/__init__.py pexpect-cli/pexpect_cli/client.py pexpect-cli/pexpect_cli/server.py pexpect-cli/tests/__init__.py pexpect-cli/tests/test_integration.py]': 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 gmaps-cli/gmaps_cli.py gmaps-cli/test_gmaps_cli_integration.py]': 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 tasker-cli/lib/tasker_cli/__init__.py tasker-cli/lib/tasker_cli/adb.py tasker-cli/lib/tasker_cli/config.py tasker-cli/lib/tasker_cli/main.py tasker-cli/lib/tasker_cli/specs.py tasker-cli/lib/tasker_cli/webui.py tasker-cli/tests/__init__.py tasker-cli/tests/conftest.py tasker-cli/tests/test_deploy.py tasker-cli/tests/test_specs.py]': 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 n8n-cli/n8n_cli/__init__.py n8n-cli/n8n_cli/client.py n8n-cli/n8n_cli/commands/__init__.py n8n-cli/n8n_cli/commands/apply.py n8n-cli/n8n_cli/commands/credential.py n8n-cli/n8n_cli/commands/datatable.py n8n-cli/n8n_cli/commands/execution.py n8n-cli/n8n_cli/commands/import_wf.py n8n-cli/n8n_cli/commands/raw.py n8n-cli/n8n_cli/commands/tag.py n8n-cli/n8n_cli/commands/test_wf.py n8n-cli/n8n_cli/commands/workflow.py n8n-cli/n8n_cli/config.py n8n-cli/n8n_cli/errors.py n8n-cli/n8n_cli/main.py n8n-cli/n8n_cli/output.py n8n-cli/n8n_cli/strip.py n8n-cli/tests/__init__.py n8n-cli/tests/conftest.py n8n-cli/tests/test_apply.py n8n-cli/tests/test_credential.py n8n-cli/tests/test_datatable.py n8n-cli/tests/test_errors.py n8n-cli/tests/test_execution.py n8n-cli/tests/test_help.py n8n-cli/tests/test_import.py n8n-cli/tests/test_raw.py n8n-cli/tests/test_tag.py n8n-cli/tests/test_test_command.py n8n-cli/tests/test_workflow.py]': 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 calendar-cli/calendar_cli/__init__.py calendar-cli/calendar_cli/cache.py calendar-cli/calendar_cli/config.py calendar-cli/calendar_cli/create.py calendar-cli/calendar_cli/email_invite.py calendar-cli/calendar_cli/errors.py calendar-cli/calendar_cli/import_invite.py calendar-cli/calendar_cli/main.py calendar-cli/calendar_cli/models.py calendar-cli/calendar_cli/parse.py calendar-cli/calendar_cli/reply.py calendar-cli/calendar_cli/store.py calendar-cli/calendar_cli/timeutil.py calendar-cli/calendar_cli/util.py calendar-cli/tests/__init__.py calendar-cli/tests/conftest.py calendar-cli/tests/helpers.py calendar-cli/tests/test_cache.py calendar-cli/tests/test_cli.py calendar-cli/tests/test_import.py calendar-cli/tests/test_invite.py calendar-cli/tests/test_reply.py calendar-cli/tests/test_store.py]': 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 2.075s430Error: failed to finalise formatting: formatting failures detected