Docs added to show how a new provider is added

Docs added to show how a new tool is created
All tools should add numbers to code for models to be able to reference if needed
Enabled line numbering for code for all tools to use
Additional tests to validate line numbering is not added to git diffs
This commit is contained in:
Fahad
2025-06-15 07:02:27 +04:00
parent b5004b91fc
commit 99fab3e83d
27 changed files with 2511 additions and 143 deletions

View File

@@ -0,0 +1,49 @@
"""
Integration test demonstrating that all tools get line numbers by default.
"""
from tools.analyze import AnalyzeTool
from tools.chat import ChatTool
from tools.codereview import CodeReviewTool
from tools.debug import DebugIssueTool
from tools.precommit import Precommit
from tools.refactor import RefactorTool
from tools.testgen import TestGenTool
class TestLineNumbersIntegration:
"""Test that all tools inherit line number behavior correctly."""
def test_all_tools_want_line_numbers(self):
"""Verify that all tools want line numbers by default."""
tools = [
ChatTool(),
AnalyzeTool(),
CodeReviewTool(),
DebugIssueTool(),
RefactorTool(),
TestGenTool(),
Precommit(),
]
for tool in tools:
assert tool.wants_line_numbers_by_default(), f"{tool.get_name()} should want line numbers by default"
def test_no_tools_override_line_numbers(self):
"""Verify that no tools override the base class line number behavior."""
# Check that tools don't have their own wants_line_numbers_by_default method
tools_classes = [
ChatTool,
AnalyzeTool,
CodeReviewTool,
DebugIssueTool,
RefactorTool,
TestGenTool,
Precommit,
]
for tool_class in tools_classes:
# Check if the method is defined in the tool class itself
# (not inherited from base)
has_override = "wants_line_numbers_by_default" in tool_class.__dict__
assert not has_override, f"{tool_class.__name__} should not override wants_line_numbers_by_default"