Skip to content

Commit dbf081c

Browse files
ayhammoudaclaude
andcommitted
fix(lint): resolve ruff E501, I001, and F541 errors breaking CI
Line-length, import-sort, and extraneous f-prefix violations that failed the GitHub Actions linter step. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 31c0525 commit dbf081c

4 files changed

Lines changed: 26 additions & 13 deletions

File tree

src/mcp_server_python_docs/models.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,10 @@ class DetectPythonVersionResult(BaseModel):
148148
description="Python major.minor detected from the user's environment (e.g. '3.13')"
149149
)
150150
source: str = Field(
151-
description="How the version was detected: '.python-version file', 'python3 in PATH', or 'server runtime'"
151+
description=(
152+
"How the version was detected: '.python-version file',"
153+
" 'python3 in PATH', or 'server runtime'"
154+
)
152155
)
153156
matched_index_version: str | None = Field(
154157
default=None,

src/mcp_server_python_docs/services/search.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
import sqlite3
1010

1111
from mcp_server_python_docs.models import SearchDocsResult
12-
from mcp_server_python_docs.services.observability import log_tool_call
13-
from mcp_server_python_docs.services.version_resolution import resolve_version_permissive
1412
from mcp_server_python_docs.retrieval.query import (
1513
build_match_expression,
1614
classify_query,
@@ -22,10 +20,13 @@
2220
search_sections,
2321
search_symbols,
2422
)
23+
from mcp_server_python_docs.services.observability import log_tool_call
24+
from mcp_server_python_docs.services.version_resolution import resolve_version_permissive
2525

2626

2727
class SearchService:
28-
"""Search service dispatching queries through classifier, synonym expansion, and FTS5/symbol fast-path."""
28+
"""Search service dispatching queries through classifier, synonym expansion,
29+
and FTS5/symbol fast-path."""
2930

3031
def __init__(self, db: sqlite3.Connection, synonyms: dict[str, list[str]]) -> None:
3132
self._db = db

tests/test_packaging.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def test_synonyms_yaml_in_wheel(self, built_wheel):
3939
names = zf.namelist()
4040
synonym_paths = [n for n in names if n.endswith("data/synonyms.yaml")]
4141
assert len(synonym_paths) == 1, (
42-
f"synonyms.yaml not found in wheel. Wheel contents:\n"
42+
"synonyms.yaml not found in wheel. Wheel contents:\n"
4343
+ "\n".join(sorted(names))
4444
)
4545
assert "mcp_server_python_docs/data/synonyms.yaml" in synonym_paths[0]
@@ -50,7 +50,7 @@ def test_schema_sql_in_wheel(self, built_wheel):
5050
names = zf.namelist()
5151
schema_paths = [n for n in names if n.endswith("storage/schema.sql")]
5252
assert len(schema_paths) >= 1, (
53-
f"schema.sql not found in wheel. Wheel contents:\n"
53+
"schema.sql not found in wheel. Wheel contents:\n"
5454
+ "\n".join(sorted(names))
5555
)
5656

tests/test_retrieval.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,24 @@ def fts_db():
6161
"'asyncio Task', 'Documentation about asyncio tasks and TaskGroup', 50)"
6262
)
6363
conn.execute(
64-
"INSERT INTO sections (id, document_id, uri, anchor, heading, level, ordinal, content_text, char_count) "
65-
"VALUES (1, 1, 'library/asyncio-task.html#asyncio.TaskGroup', 'asyncio.TaskGroup', "
66-
"'asyncio.TaskGroup', 2, 1, "
67-
"'A context manager that holds a group of tasks. Tasks can be added with create_task. All tasks are awaited on exit.', 100)"
64+
"INSERT INTO sections"
65+
" (id, document_id, uri, anchor, heading, level, ordinal,"
66+
" content_text, char_count) "
67+
"VALUES (1, 1, 'library/asyncio-task.html#asyncio.TaskGroup',"
68+
" 'asyncio.TaskGroup', 'asyncio.TaskGroup', 2, 1, "
69+
"'A context manager that holds a group of tasks."
70+
" Tasks can be added with create_task."
71+
" All tasks are awaited on exit.', 100)"
6872
)
6973
conn.execute(
70-
"INSERT INTO sections (id, document_id, uri, anchor, heading, level, ordinal, content_text, char_count) "
71-
"VALUES (2, 1, 'library/asyncio-task.html#introduction', 'introduction', "
72-
"'Introduction', 1, 0, 'This page describes asyncio tasks and how to use TaskGroup for concurrent execution.', 80)"
74+
"INSERT INTO sections"
75+
" (id, document_id, uri, anchor, heading, level, ordinal,"
76+
" content_text, char_count) "
77+
"VALUES (2, 1, 'library/asyncio-task.html#introduction',"
78+
" 'introduction', "
79+
"'Introduction', 1, 0,"
80+
" 'This page describes asyncio tasks and how to use"
81+
" TaskGroup for concurrent execution.', 80)"
7382
)
7483
conn.execute(
7584
"INSERT INTO symbols (id, doc_set_id, qualified_name, normalized_name, module, "

0 commit comments

Comments
 (0)