Skip to content

Commit 7e024a8

Browse files
committed
fix: resolve linting errors for release preparation
- Replace bare except clauses with Exception in legal_file_inventory.py - Remove unused variables in test files - Prepare codebase for v0.14.4 release
1 parent 22f7bfa commit 7e024a8

File tree

5 files changed

+9
-13
lines changed

5 files changed

+9
-13
lines changed

legal_file_inventory.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,13 @@ def get_file_contributors(self, file_path: str) -> Dict[str, int]:
9595
blame_output = self.run_git_command(['blame', '--line-porcelain', file_path])
9696
contributors = {}
9797

98-
current_commit = None
9998
for line in blame_output.split('\n'):
10099
if line.startswith('author '):
101100
author = line[7:] # Remove 'author ' prefix
102101
contributors[author] = contributors.get(author, 0) + 1
103102

104103
return contributors
105-
except:
104+
except Exception:
106105
return {}
107106

108107
def get_file_history(self, file_path: str) -> Dict[str, any]:
@@ -134,7 +133,7 @@ def get_file_history(self, file_path: str) -> Dict[str, any]:
134133
'last_modified': last_commit or 'Unknown',
135134
'commit_count': commit_count
136135
}
137-
except:
136+
except Exception:
138137
return {
139138
'created': 'Unknown',
140139
'last_modified': 'Unknown',
@@ -165,7 +164,7 @@ def calculate_file_hash(self, file_path: Path) -> str:
165164
try:
166165
with open(file_path, 'rb') as f:
167166
return hashlib.sha256(f.read()).hexdigest()
168-
except:
167+
except Exception:
169168
return ""
170169

171170
def categorize_file(self, file_path: Path) -> str:
@@ -229,7 +228,7 @@ def scan_repository(self):
229228
stat_info = file_path.stat()
230229
file_size = stat_info.st_size
231230
modified_time = datetime.fromtimestamp(stat_info.st_mtime)
232-
except:
231+
except Exception:
233232
file_size = 0
234233
modified_time = datetime.now()
235234

src/basic_memory/markdown/markdown_processor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from typing import Optional
33
from collections import OrderedDict
44

5-
import frontmatter
65
from frontmatter import Post
76
from loguru import logger
87

tests/db/test_issue_254_foreign_key_constraints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ async def test_issue_254_reproduction(project_service: ProjectService, tmp_path)
139139
"created_at": datetime.now(timezone.utc),
140140
"updated_at": datetime.now(timezone.utc),
141141
}
142-
entity = await entity_repo.create(entity_data)
142+
await entity_repo.create(entity_data)
143143

144144
# This should eventually work without errors once issue #254 is fixed
145145
#with pytest.raises(Exception) as exc_info:

tests/mcp/test_obsidian_yaml_formatting.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Integration tests for Obsidian-compatible YAML formatting in write_note tool."""
22

33
import pytest
4-
from pathlib import Path
54

65
from basic_memory.mcp.tools import write_note
76

@@ -70,7 +69,7 @@ async def test_write_note_stringified_json_tags(app, project_config):
7069
@pytest.mark.asyncio
7170
async def test_write_note_single_tag_yaml_format(app, project_config):
7271
"""Test that single tags are still formatted as YAML lists."""
73-
result = await write_note.fn(
72+
await write_note.fn(
7473
title="Single Tag Test",
7574
folder="test",
7675
content="Testing single tag formatting",
@@ -88,7 +87,7 @@ async def test_write_note_single_tag_yaml_format(app, project_config):
8887
@pytest.mark.asyncio
8988
async def test_write_note_no_tags(app, project_config):
9089
"""Test that notes without tags work normally."""
91-
result = await write_note.fn(
90+
await write_note.fn(
9291
title="No Tags Test",
9392
folder="test",
9493
content="Testing note without tags",
@@ -106,7 +105,7 @@ async def test_write_note_no_tags(app, project_config):
106105
@pytest.mark.asyncio
107106
async def test_write_note_empty_tags_list(app, project_config):
108107
"""Test that empty tag lists are handled properly."""
109-
result = await write_note.fn(
108+
await write_note.fn(
110109
title="Empty Tags Test",
111110
folder="test",
112111
content="Testing empty tag list",
@@ -164,7 +163,7 @@ async def test_write_note_update_preserves_yaml_format(app, project_config):
164163
@pytest.mark.asyncio
165164
async def test_complex_tags_yaml_format(app, project_config):
166165
"""Test that complex tags with special characters format correctly."""
167-
result = await write_note.fn(
166+
await write_note.fn(
168167
title="Complex Tags Test",
169168
folder="test",
170169
content="Testing complex tag formats",

tests/utils/test_frontmatter_obsidian_compatible.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Tests for Obsidian-compatible YAML frontmatter formatting."""
22

3-
import pytest
43
import frontmatter
54

65
from basic_memory.file_utils import dump_frontmatter

0 commit comments

Comments
 (0)