Skip to content

Commit 2aca19a

Browse files
committed
chore: apply ruff formatting
1 parent 827f7cf commit 2aca19a

4 files changed

Lines changed: 13 additions & 13 deletions

File tree

src/basic_memory/mcp/tools/search.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def _format_search_error_response(error_message: str, query: str, search_type: s
5454
```
5555
5656
## Alternative search strategies:
57-
- Break into simpler terms: `search_notes("{' '.join(clean_query.split()[:2])}")`
57+
- Break into simpler terms: `search_notes("{" ".join(clean_query.split()[:2])}")`
5858
- Try different search types: `search_notes("{clean_query}", search_type="title")`
5959
- Use filtering: `search_notes("{clean_query}", types=["entity"])`
6060
""").strip()
@@ -105,7 +105,7 @@ def _format_search_error_response(error_message: str, query: str, search_type: s
105105
- **Permalink search**: `search_notes("{query}", search_type="permalink")` (searches file paths)
106106
107107
4. **Try boolean operators for broader results**:
108-
- OR search: `search_notes("{' OR '.join(query.split()[:3])}")`
108+
- OR search: `search_notes("{" OR ".join(query.split()[:3])}")`
109109
- Remove restrictive terms: Focus on the most important keywords
110110
111111
5. **Use filtering to narrow scope**:
@@ -183,7 +183,7 @@ def _format_search_error_response(error_message: str, query: str, search_type: s
183183
- Permalink patterns: `search_notes("{query}*", search_type="permalink")`
184184
- **With filters**: `search_notes("{query}", types=["entity"])`
185185
- **Recent content**: `search_notes("{query}", after_date="1 week")`
186-
- **Boolean variations**: `search_notes("{' OR '.join(query.split()[:2])}")`
186+
- **Boolean variations**: `search_notes("{" OR ".join(query.split()[:2])}")`
187187
188188
## Explore your content:
189189
- **Browse files**: `list_directory("/")` - See all available content
@@ -224,7 +224,7 @@ async def search_notes(
224224
- `search_notes("keyword")` - Find any content containing "keyword"
225225
- `search_notes("exact phrase")` - Search for exact phrase match
226226
227-
### Advanced Boolean Searches
227+
### Advanced Boolean Searches
228228
- `search_notes("term1 term2")` - Find content with both terms (implicit AND)
229229
- `search_notes("term1 AND term2")` - Explicit AND search (both terms required)
230230
- `search_notes("term1 OR term2")` - Either term can be present

tests/mcp/test_tool_edit_note.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ async def test_edit_note_find_replace_empty_find_text(client):
364364
@pytest.mark.asyncio
365365
async def test_edit_note_preserves_permalink_when_frontmatter_missing(client):
366366
"""Test that editing a note preserves the permalink when frontmatter doesn't contain one.
367-
367+
368368
This is a regression test for issue #170 where edit_note would fail with a validation error
369369
because the permalink was being set to None when the markdown file didn't have a permalink
370370
in its frontmatter.
@@ -382,15 +382,15 @@ async def test_edit_note_preserves_permalink_when_frontmatter_missing(client):
382382
operation="append",
383383
content="\nFirst edit.",
384384
)
385-
385+
386386
assert isinstance(first_result, str)
387387
assert "permalink: test/test-note" in first_result
388-
389-
# Perform another edit - this should preserve the permalink even if the
388+
389+
# Perform another edit - this should preserve the permalink even if the
390390
# file doesn't have a permalink in its frontmatter
391391
second_result = await edit_note.fn(
392392
identifier="test/test-note",
393-
operation="append",
393+
operation="append",
394394
content="\nSecond edit.",
395395
)
396396

tests/mcp/test_tool_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ async def test_search_title(client):
5151

5252
# Verify results - handle both success and error cases
5353
if isinstance(response, str):
54-
# If search failed and returned error message, test should fail with informative message
54+
# If search failed and returned error message, test should fail with informative message
5555
pytest.fail(f"Search failed with error: {response}")
5656
else:
5757
# Success case - verify SearchResponse

tests/schemas/test_schemas.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ def test_entity_out_from_attributes():
129129

130130
def test_entity_response_with_none_permalink():
131131
"""Test EntityResponse can handle None permalink (fixes issue #170).
132-
132+
133133
This test ensures that EntityResponse properly validates when the permalink
134-
field is None, which can occur when markdown files don't have explicit
134+
field is None, which can occur when markdown files don't have explicit
135135
permalinks in their frontmatter during edit operations.
136136
"""
137137
# Simulate database model attributes with None permalink
@@ -146,7 +146,7 @@ def test_entity_response_with_none_permalink():
146146
"created_at": "2023-01-01T00:00:00",
147147
"updated_at": "2023-01-01T00:00:00",
148148
}
149-
149+
150150
# This should not raise a ValidationError
151151
entity = EntityResponse.model_validate(db_data)
152152
assert entity.permalink is None

0 commit comments

Comments
 (0)