From bdd1362972f4d400a481f7d25c8d675ff8366d55 Mon Sep 17 00:00:00 2001 From: Jer Miller Date: Fri, 6 Mar 2026 16:07:59 -0700 Subject: [PATCH] Style: apply consistent formatting across importer modules Co-Authored-By: Claude Opus 4.6 --- tests/test_gemini_importer.py | 4 +--- tests/test_import_dedup.py | 1 - tests/test_import_formatting.py | 4 +--- think/formatters.py | 6 +++++- think/importers/cli.py | 4 +++- think/importers/formatting.py | 6 +++++- think/importers/shared.py | 4 +--- 7 files changed, 16 insertions(+), 13 deletions(-) diff --git a/tests/test_gemini_importer.py b/tests/test_gemini_importer.py index 0fb065461..eb487a3e4 100644 --- a/tests/test_gemini_importer.py +++ b/tests/test_gemini_importer.py @@ -138,9 +138,7 @@ def test_detect_directory(): with tempfile.TemporaryDirectory() as tmpdir: activity_dir = Path(tmpdir) / "My Activity" / "Gemini Apps" activity_dir.mkdir(parents=True) - (activity_dir / "MyActivity.json").write_text( - json.dumps([_sample_activity()]) - ) + (activity_dir / "MyActivity.json").write_text(json.dumps([_sample_activity()])) assert importer.detect(Path(tmpdir)) is True diff --git a/tests/test_import_dedup.py b/tests/test_import_dedup.py index c0ab28ac2..b4731b529 100644 --- a/tests/test_import_dedup.py +++ b/tests/test_import_dedup.py @@ -17,7 +17,6 @@ from think.importers.shared import ( write_structured_import, ) - # --- hash_source tests --- diff --git a/tests/test_import_formatting.py b/tests/test_import_formatting.py index 72ed985b0..56c5e113a 100644 --- a/tests/test_import_formatting.py +++ b/tests/test_import_formatting.py @@ -280,9 +280,7 @@ def test_format_file_integration(): "title": "Lunch with Alice", "content": "", } - jsonl_path.write_text( - json.dumps(header) + "\n" + json.dumps(entry) + "\n" - ) + jsonl_path.write_text(json.dumps(header) + "\n" + json.dumps(entry) + "\n") chunks, meta = format_file(str(jsonl_path)) assert len(chunks) == 1 diff --git a/think/formatters.py b/think/formatters.py index 24a83f253..55980f0ff 100644 --- a/think/formatters.py +++ b/think/formatters.py @@ -141,7 +141,11 @@ FORMATTERS: dict[str, tuple[str, str, bool]] = { "facets/*/todos/*.jsonl": ("apps.todos.todo", "format_todos", True), "facets/*/logs/*.jsonl": ("think.facets", "format_logs", True), # Structured file imports (indexed) - "*/import.*/imported.jsonl": ("think.importers.formatting", "format_imported", True), + "*/import.*/imported.jsonl": ( + "think.importers.formatting", + "format_imported", + True, + ), # Raw transcripts — formattable but not indexed (agent outputs are more useful) # Layout: day/stream/segment/audio.jsonl "*/*/*/audio.jsonl": ("observe.hear", "format_audio", False), diff --git a/think/importers/cli.py b/think/importers/cli.py index 745b1d8af..e673d56a3 100644 --- a/think/importers/cli.py +++ b/think/importers/cli.py @@ -660,7 +660,9 @@ def main() -> None: { os.path.basename(os.path.dirname(os.path.dirname(f))) for f in result.files_created - if os.path.basename(os.path.dirname(os.path.dirname(f))).isdigit() + if os.path.basename( + os.path.dirname(os.path.dirname(f)) + ).isdigit() } ) if days_affected: diff --git a/think/importers/formatting.py b/think/importers/formatting.py index 9d152fa99..d2b3c50bb 100644 --- a/think/importers/formatting.py +++ b/think/importers/formatting.py @@ -107,7 +107,11 @@ def _format_calendar_event(entry: dict) -> str: attendees = entry.get("attendees", []) if attendees: - names = [a.get("name") or a.get("email", "") for a in attendees if isinstance(a, dict)] + names = [ + a.get("name") or a.get("email", "") + for a in attendees + if isinstance(a, dict) + ] if not names: names = [str(a) for a in attendees] if names: diff --git a/think/importers/shared.py b/think/importers/shared.py index 2609f2262..18181cb0d 100644 --- a/think/importers/shared.py +++ b/think/importers/shared.py @@ -344,9 +344,7 @@ def write_manifest( return manifest_path -def find_manifest_by_hash( - journal_root: Path, source_hash: str -) -> dict | None: +def find_manifest_by_hash(journal_root: Path, source_hash: str) -> dict | None: """Search existing import manifests for a matching source hash. Returns the manifest dict if found, None otherwise. -- 2.51.2