Skip to content

Commit f72678c

Browse files
committed
black fixes | prompt clarified to avoid method signature copying
1 parent 198a1e1 commit f72678c

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

osa_tool/operations/codebase/docstring_generation/docgen.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ async def generate_method_documentation(
286286
f"- Method Name: {method_details['method_name']}\n\n"
287287
"Method source code: You are given only the body of a single method, without its signature. "
288288
"All visible code, including any inner functions or nested logic, belongs to this single method. "
289-
"Do not write separate docstrings for inner functions — they are part of the main method's logic.\n"
289+
"Do NOT write separate docstrings for inner functions — they are part of the main method's logic.\n"
290+
"Do NOT repeat the function signature or decorators.\n"
290291
"```\n"
291292
f"{method_details['source_code']}\n"
292293
"```\n\n"
@@ -368,6 +369,7 @@ async def update_method_documentation(
368369
f"The main idea of the project (for context only): {self.main_idea}\n\n"
369370
"Return only the updated docstring.\n"
370371
"DO NOT return code.\n"
372+
"Do NOT repeat the function signature or decorators.\n"
371373
"DO NOT return other documentation sections.\n"
372374
"Return only the docstring without any quotation marks.\n"
373375
)

osa_tool/operations/codebase/docstring_generation/docstring_transformer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
IndentedBlock,
88
)
99
from typing import Sequence
10-
import json
1110

1211

1312
class DocstringTransformer(CSTTransformer):

tests/unit/osatreesitter/test_docgen.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ async def test_generate_method_documentation(mock_config_manager):
260260
docstring = await docgen.generate_method_documentation(method_details, semaphore)
261261

262262
# Assert
263-
assert docstring == 'Generated docstring'
263+
assert docstring == "Generated docstring"
264264
docgen.model_handler.async_request.assert_called_once()
265265

266266

@@ -285,7 +285,7 @@ async def test_update_method_documentation(mock_config_manager):
285285
updated_doc = await docgen.update_method_documentation(method_details, semaphore)
286286

287287
# Assert
288-
assert updated_doc == 'Updated docstring'
288+
assert updated_doc == "Updated docstring"
289289
docgen.model_handler.async_request.assert_called_once()
290290

291291

0 commit comments

Comments
 (0)