treefmt v2.5.0ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 1 CPY001 Missing copyright notice at top of file --> weather-cli/lib/weather_cli/__init__.py:1:1 CPY001 Missing copyright notice at top of file --> weather-cli/lib/weather_cli/main.py:1:1 Found 2 errors. ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 1 BLE001 Do not catch blind exception: `Exception` --> kagi-search/kagi_search.py:199:16 | 197 | print(stderr_msg, file=sys.stderr) 198 | sys.exit(1) 199 | except Exception as e: | ^^^^^^^^^ 200 | error_msg = colorize(f"Error getting session token: {e}", color="red", bold=True) 201 | print(error_msg, file=sys.stderr) | TRY002 Create your own exception --> kagi-search/kagi_search.py:218:23 | 216 | return # Success 217 | elif "/signin" in final_url or "/welcome" in final_url: 218 | raise Exception(f"Authentication failed - redirected to {final_url}") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 219 | except Exception as e: 220 | raise Exception(f"Failed to authenticate with token: {e}") | BLE001 Do not catch blind exception: `Exception` --> kagi-search/kagi_search.py:219:16 | 217 | elif "/signin" in final_url or "/welcome" in final_url: 218 | raise Exception(f"Authentication failed - redirected to {final_url}") 219 | except Exception as e: | ^^^^^^^^^ 220 | raise Exception(f"Failed to authenticate with token: {e}") | TRY002 Create your own exception --> kagi-search/kagi_search.py:220:19 | 218 | raise Exception(f"Authentication failed - redirected to {final_url}") 219 | except Exception as e: 220 | raise Exception(f"Failed to authenticate with token: {e}") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 221 | 222 | def search(self, query: str, limit: int = 10) -> list[SearchResult]: | TRY002 Create your own exception --> kagi-search/kagi_search.py:260:27 | 258 | final_url = response.geturl() 259 | if "/signin" in final_url or "/welcome" in final_url: 260 | raise Exception(f"Authentication failed - redirected to {final_url}") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 261 | 262 | # Read response | TRY002 Create your own exception --> kagi-search/kagi_search.py:280:27 | 278 | time.sleep(retry_delay) 279 | continue 280 | raise Exception("No results box found on page") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 281 | 282 | # Extract search results | TRY004 Prefer `TypeError` exception for invalid type --> kagi-search/kagi_search.py:285:21 | 283 | results = [] 284 | if not isinstance(results_box, Tag): 285 | raise Exception("Results box is not a Tag element") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 286 | search_results = results_box.find_all(class_="search-result") | TRY002 Create your own exception --> kagi-search/kagi_search.py:285:27 | 283 | results = [] 284 | if not isinstance(results_box, Tag): 285 | raise Exception("Results box is not a Tag element") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 286 | search_results = results_box.find_all(class_="search-result") | TRY002 Create your own exception --> kagi-search/kagi_search.py:332:23 | 330 | time.sleep(retry_delay) 331 | continue 332 | raise Exception(f"Request failed: {e}") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 333 | 334 | return [] | TRY002 Create your own exception --> kagi-search/kagi_search.py:385:23 | 383 | logger.debug(f"Final URL: {final_url}") 384 | if "/signin" in final_url or "/welcome" in final_url: 385 | raise Exception(f"Authentication failed - redirected to {final_url}") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 386 | 387 | # Read response | BLE001 Do not catch blind exception: `Exception` --> kagi-search/kagi_search.py:460:16 | 458 | ) 459 | 460 | except Exception as e: | ^^^^^^^^^ 461 | # Quick Answer might not be available for all queries 462 | logger.debug(f"Quick Answer error: {type(e).__name__}: {e}") | BLE001 Do not catch blind exception: `Exception` --> kagi-search/kagi_search.py:500:12 | 498 | try: 499 | client = KagiSearch(session_token=args.token, config_path=args.config) 500 | except Exception as e: | ^^^^^^^^^ 501 | error_msg = colorize(f"Error initializing Kagi client: {e}", color="red", bold=True) 502 | print(error_msg, file=sys.stderr) | BLE001 Do not catch blind exception: `Exception` --> kagi-search/kagi_search.py:509:12 | 507 | results = client.search(args.query, limit=args.num_results) if args.links else [] 508 | quick_answer = client.get_quick_answer(args.query) 509 | except Exception as e: | ^^^^^^^^^ 510 | error_msg = colorize(f"Search failed: {e}", color="red", bold=True) 511 | print(error_msg, file=sys.stderr) | Found 28 errors (15 fixed, 13 remaining). ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 1 CPY001 Missing copyright notice at top of file --> browser-cli/browser_cli/__init__.py:1:1 CPY001 Missing copyright notice at top of file --> browser-cli/browser_cli/__main__.py:1:1 CPY001 Missing copyright notice at top of file --> browser-cli/browser_cli/bridge.py:1:1 CPY001 Missing copyright notice at top of file --> browser-cli/browser_cli/browsh.py:1:1 CPY001 Missing copyright notice at top of file --> browser-cli/browser_cli/cli.py:1:1 CPY001 Missing copyright notice at top of file --> browser-cli/browser_cli/client.py:1:1 CPY001 Missing copyright notice at top of file --> browser-cli/browser_cli/config.py:1:1 CPY001 Missing copyright notice at top of file --> browser-cli/browser_cli/errors.py:1:1 CPY001 Missing copyright notice at top of file --> browser-cli/browser_cli/paths.py:1:1 CPY001 Missing copyright notice at top of file --> browser-cli/browser_cli/server.py:1:1 Found 10 errors. ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 1 EXE001 Shebang is present but file is not executable --> screenshot-cli/screenshot_cli.py:1:1 | 1 | #!/usr/bin/env python3 | ^^^^^^^^^^^^^^^^^^^^^^ 2 | """Non-interactive screenshot CLI for agent use on macOS and Linux Wayland. | DTZ005 `datetime.datetime.now()` called without a `tz` argument --> screenshot-cli/screenshot_cli.py:261:14 | 259 | # Include microseconds: niri actions complete in ~150ms so two calls 260 | # easily land in the same wall-clock second and clobber each other. 261 | ts = datetime.now().strftime("%Y%m%d-%H%M%S-%f") | ^^^^^^^^^^^^^^ 262 | output = str(outdir / f"screenshot-{ts}.png") 263 | Path(output).parent.mkdir(parents=True, exist_ok=True) | help: Pass a `datetime.timezone` object to the `tz` parameter Found 3 errors (1 fixed, 2 remaining). ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 1 CPY001 Missing copyright notice at top of file --> pexpect-cli/pexpect_cli/__init__.py:1:1 CPY001 Missing copyright notice at top of file --> pexpect-cli/pexpect_cli/client.py:1:1 CPY001 Missing copyright notice at top of file --> pexpect-cli/pexpect_cli/server.py:1:1 CPY001 Missing copyright notice at top of file --> pexpect-cli/tests/__init__.py:1:1 CPY001 Missing copyright notice at top of file --> pexpect-cli/tests/test_integration.py:1:1 Found 5 errors. ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 1 CPY001 Missing copyright notice at top of file --> gmaps-cli/gmaps_cli.py:1:1 CPY001 Missing copyright notice at top of file --> gmaps-cli/test_gmaps_cli_integration.py:1:1 Found 5 errors (3 fixed, 2 remaining). ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 1 CPY001 Missing copyright notice at top of file --> tasker-cli/lib/tasker_cli/__init__.py:1:1 CPY001 Missing copyright notice at top of file --> tasker-cli/lib/tasker_cli/adb.py:1:1 CPY001 Missing copyright notice at top of file --> tasker-cli/lib/tasker_cli/config.py:1:1 CPY001 Missing copyright notice at top of file --> tasker-cli/lib/tasker_cli/main.py:1:1 CPY001 Missing copyright notice at top of file --> tasker-cli/lib/tasker_cli/specs.py:1:1 CPY001 Missing copyright notice at top of file --> tasker-cli/lib/tasker_cli/webui.py:1:1 RUF036 `None` not at the end of the type union. --> tasker-cli/lib/tasker_cli/webui.py:17:5 | 15 | # JSON type aliases for the untyped WebUI responses 16 | type JsonValue = ( 17 | str | int | float | bool | None | list[JsonValue] | dict[str, JsonValue] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 18 | ) | help: Move `None` to the end of the type union CPY001 Missing copyright notice at top of file --> tasker-cli/tests/__init__.py:1:1 CPY001 Missing copyright notice at top of file --> tasker-cli/tests/conftest.py:1:1 CPY001 Missing copyright notice at top of file --> tasker-cli/tests/test_deploy.py:1:1 CPY001 Missing copyright notice at top of file --> tasker-cli/tests/test_specs.py:1:1 Found 11 errors. No fixes available (1 hidden fix can be enabled with the `--unsafe-fixes` option). ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 1 SIM102 Use a single `if` statement instead of nested `if` statements --> n8n-cli/n8n_cli/commands/apply.py:64:13 | 63 | # Filter by IDs if specified 64 | / if ids: 65 | | if not wf_id or wf_id not in ids: | |_________________________________________________^ 66 | continue | help: Combine `if` statements using `and` SIM103 Return the condition `local.get("active") != remote.get("active")` directly --> n8n-cli/n8n_cli/commands/apply.py:137:5 | 135 | return True 136 | # Compare active state 137 | / if local.get("active") != remote.get("active"): 138 | | return True 139 | | return False | |________________^ help: Replace with `return local.get("active") != remote.get("active")` SIM102 Use a single `if` statement instead of nested `if` statements --> n8n-cli/n8n_cli/commands/apply.py:224:9 | 222 | local_updated = data.get("updatedAt") 223 | remote_updated = remote.get("updatedAt") 224 | / if local_updated and remote_updated and remote_updated > local_updated: 225 | | if not ns.force: | |____________________________^ 226 | print( 227 | f" conflict: {basename} (remote is newer: {remote_updated} > {local_updated})" | help: Combine `if` statements using `and` SIM117 Use a single `with` statement with multiple contexts instead of nested `with` statements --> n8n-cli/tests/test_errors.py:14:9 | 12 | """Missing API URL/key produces a ConfigError, not a traceback.""" 13 | env = {"N8N_API_URL": "", "N8N_API_KEY": ""} 14 | / with patch.dict("os.environ", env, clear=False): 15 | | with patch("sys.argv", ["n8n-cli", "credential", "list"]): | |______________________________________________________________________^ 16 | with pytest.raises(SystemExit) as exc_info: 17 | main() | help: Combine `with` statements SIM117 Use a single `with` statement with multiple contexts instead of nested `with` statements --> n8n-cli/tests/test_errors.py:24:9 | 22 | def test_unknown_command(self, capsys: pytest.CaptureFixture[str]) -> None: 23 | """Unknown top-level command exits with code 2 (argparse error).""" 24 | / with patch.dict("os.environ", {"N8N_API_URL": "x", "N8N_API_KEY": "x"}): 25 | | with patch("sys.argv", ["n8n-cli", "bogus"]): | |_________________________________________________________^ 26 | with pytest.raises(SystemExit) as exc_info: 27 | main() | help: Combine `with` statements Found 16 errors (11 fixed, 5 remaining). No fixes available (2 hidden fixes can be enabled with the `--unsafe-fixes` option). ERRO formatter | ruff-check: failed to apply with options '[check --fix]': exit status 1 CPY001 Missing copyright notice at top of file --> calendar-cli/calendar_cli/__init__.py:1:1 CPY001 Missing copyright notice at top of file --> calendar-cli/calendar_cli/cache.py:1:1 CPY001 Missing copyright notice at top of file --> calendar-cli/calendar_cli/config.py:1:1 CPY001 Missing copyright notice at top of file --> calendar-cli/calendar_cli/create.py:1:1 CPY001 Missing copyright notice at top of file --> calendar-cli/calendar_cli/email_invite.py:1:1 CPY001 Missing copyright notice at top of file --> calendar-cli/calendar_cli/errors.py:1:1 CPY001 Missing copyright notice at top of file --> calendar-cli/calendar_cli/import_invite.py:1:1 CPY001 Missing copyright notice at top of file --> calendar-cli/calendar_cli/main.py:1:1 CPY001 Missing copyright notice at top of file --> calendar-cli/calendar_cli/models.py:1:1 CPY001 Missing copyright notice at top of file --> calendar-cli/calendar_cli/parse.py:1:1 CPY001 Missing copyright notice at top of file --> calendar-cli/calendar_cli/reply.py:1:1 CPY001 Missing copyright notice at top of file --> calendar-cli/calendar_cli/store.py:1:1 CPY001 Missing copyright notice at top of file --> calendar-cli/calendar_cli/timeutil.py:1:1 CPY001 Missing copyright notice at top of file --> calendar-cli/calendar_cli/util.py:1:1 CPY001 Missing copyright notice at top of file --> calendar-cli/tests/__init__.py:1:1 CPY001 Missing copyright notice at top of file --> calendar-cli/tests/conftest.py:1:1 CPY001 Missing copyright notice at top of file --> calendar-cli/tests/helpers.py:1:1 CPY001 Missing copyright notice at top of file --> calendar-cli/tests/test_cache.py:1:1 CPY001 Missing copyright notice at top of file --> calendar-cli/tests/test_cli.py:1:1 CPY001 Missing copyright notice at top of file --> calendar-cli/tests/test_import.py:1:1 CPY001 Missing copyright notice at top of file --> calendar-cli/tests/test_invite.py:1:1 CPY001 Missing copyright notice at top of file --> calendar-cli/tests/test_reply.py:1:1 CPY001 Missing copyright notice at top of file --> calendar-cli/tests/test_store.py:1:1 Found 23 errors. traversed 188 files emitted 166 files for processing formatted 81 files (8 changed) in 4.493s Error: failed to finalise formatting: formatting failures detected