From a6e9aaf4565b4de80c75c7bdcfe9c7f28eb93635 Mon Sep 17 00:00:00 2001 From: Jason Hamilton Date: Sat, 26 Jul 2025 14:54:38 -0400 Subject: [PATCH] Fix formatting failures and add AGENTS guide --- AGENTS.md | 21 +++++++++++++++++++++ raindrop_cleanup/ui/interfaces.py | 4 +--- tests/unit/test_cli_main.py | 7 ++++--- 3 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..46727ed --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,21 @@ +# AGENTS.md + +This repository uses the development workflow described in `CLAUDE.md`. When making code changes you should: + +* Install dependencies with `pip install -e ".[dev]"`. +* Format code with **Black** and ensure it passes in check mode. +* Lint using **ruff**. +* Type check using **mypy**. +* Run the unit tests with `pytest`. + +All of these checks must succeed before committing. + +The project is an AI‑powered bookmark cleanup tool for Raindrop.io built with a modular architecture. The main modules include: + +* `api/raindrop_client.py` for Raindrop API access +* `ai/claude_analyzer.py` for Claude AI integration +* `ui/interfaces.py` for keyboard and text interfaces +* `state/manager.py` for persistence of session state +* `cli/main.py` for the command‑line interface + +The test suite under `tests/` uses pytest with extensive mocking of external services. diff --git a/raindrop_cleanup/ui/interfaces.py b/raindrop_cleanup/ui/interfaces.py index 94c7d78..5688271 100644 --- a/raindrop_cleanup/ui/interfaces.py +++ b/raindrop_cleanup/ui/interfaces.py @@ -312,9 +312,7 @@ def _display_text_interface( return [] elif user_input == "all": return [ - i - for i, d in enumerate(decisions) - if d.get("action") != "KEEP" + i for i, d in enumerate(decisions) if d.get("action") != "KEEP" ] elif user_input == "deletes": return [ diff --git a/tests/unit/test_cli_main.py b/tests/unit/test_cli_main.py index 87b6cdb..b3046aa 100644 --- a/tests/unit/test_cli_main.py +++ b/tests/unit/test_cli_main.py @@ -341,9 +341,10 @@ def test_debug_environment_variable(self, mock_input, mock_cleaner, mock_getenv) @patch("builtins.print") def test_missing_env_vars_precheck(self, mock_print): """CLI should exit early when required env vars are missing.""" - with patch.dict(os.environ, {}, clear=True), patch( - "raindrop_cleanup.cli.main.RaindropBookmarkCleaner" - ) as mock_cleaner: + with ( + patch.dict(os.environ, {}, clear=True), + patch("raindrop_cleanup.cli.main.RaindropBookmarkCleaner") as mock_cleaner, + ): main() mock_cleaner.assert_not_called()