Skip to content

Commit 637d02f

Browse files
committed
ran pre-commit to fix formatting
removed un-used import in git.py, navigator_coder.py
1 parent 7b64935 commit 637d02f

3 files changed

Lines changed: 32 additions & 29 deletions

File tree

aider/coders/navigator_coder.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@
5656
from aider.tools.delete_line import _execute_delete_line
5757
from aider.tools.delete_lines import _execute_delete_lines
5858
from aider.tools.extract_lines import _execute_extract_lines
59+
from aider.tools.git import (
60+
_execute_git_diff,
61+
_execute_git_log,
62+
_execute_git_show,
63+
_execute_git_status,
64+
git_diff_schema,
65+
git_log_schema,
66+
git_show_schema,
67+
git_status_schema,
68+
)
5969
from aider.tools.grep import _execute_grep
6070
from aider.tools.indent_lines import _execute_indent_lines
6171
from aider.tools.insert_block import _execute_insert_block
@@ -75,20 +85,7 @@
7585

7686
# Import tool functions
7787
from aider.tools.view_files_matching import execute_view_files_matching
78-
from aider.tools.view_files_with_symbol import (
79-
_execute_view_files_with_symbol,
80-
view_files_with_symbol_schema,
81-
)
82-
from aider.tools.git import (
83-
_execute_git_diff,
84-
_execute_git_log,
85-
_execute_git_show,
86-
_execute_git_status,
87-
git_diff_schema,
88-
git_log_schema,
89-
git_show_schema,
90-
git_status_schema,
91-
)
88+
from aider.tools.view_files_with_symbol import _execute_view_files_with_symbol
9289

9390
from .base_coder import ChatChunks, Coder
9491
from .editblock_coder import do_replace, find_original_update_blocks, find_similar_lines

aider/tools/__init__.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@
1010
from .delete_line import _execute_delete_line, delete_line_schema
1111
from .delete_lines import _execute_delete_lines, delete_lines_schema
1212
from .extract_lines import _execute_extract_lines, extract_lines_schema
13+
from .git import (
14+
_execute_git_diff,
15+
_execute_git_log,
16+
_execute_git_show,
17+
_execute_git_status,
18+
git_diff_schema,
19+
git_log_schema,
20+
git_show_schema,
21+
git_status_schema,
22+
)
1323
from .grep import _execute_grep, grep_schema
1424
from .indent_lines import _execute_indent_lines, indent_lines_schema
1525
from .insert_block import _execute_insert_block, insert_block_schema
@@ -35,13 +45,3 @@
3545
_execute_view_files_with_symbol,
3646
view_files_with_symbol_schema,
3747
)
38-
from .git import (
39-
_execute_git_diff,
40-
_execute_git_log,
41-
_execute_git_show,
42-
_execute_git_status,
43-
git_diff_schema,
44-
git_log_schema,
45-
git_show_schema,
46-
git_status_schema,
47-
)

aider/tools/git.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
# aider/tools/git.py
2-
3-
import traceback
41
from aider.repo import ANY_GIT_ERROR
52

63
git_diff_schema = {
74
"type": "function",
85
"function": {
96
"name": "git_diff",
10-
"description": "Show the diff between the current working directory and a git branch or commit.",
7+
"description": (
8+
"Show the diff between the current working directory and a git branch or commit."
9+
),
1110
"parameters": {
1211
"type": "object",
1312
"properties": {
@@ -21,6 +20,7 @@
2120
},
2221
}
2322

23+
2424
def _execute_git_diff(coder, branch=None):
2525
"""
2626
Show the diff between the current working directory and a git branch or commit.
@@ -41,6 +41,7 @@ def _execute_git_diff(coder, branch=None):
4141
coder.io.tool_error(f"Error running git diff: {e}")
4242
return f"Error running git diff: {e}"
4343

44+
4445
git_log_schema = {
4546
"type": "function",
4647
"function": {
@@ -59,6 +60,7 @@ def _execute_git_diff(coder, branch=None):
5960
},
6061
}
6162

63+
6264
def _execute_git_log(coder, limit=10):
6365
"""
6466
Show the git log.
@@ -71,13 +73,14 @@ def _execute_git_log(coder, limit=10):
7173
log_output = []
7274
for commit in commits:
7375
short_hash = commit.hexsha[:8]
74-
message = commit.message.strip().split('\n')[0]
76+
message = commit.message.strip().split("\n")[0]
7577
log_output.append(f"{short_hash} {message}")
7678
return "\n".join(log_output)
7779
except ANY_GIT_ERROR as e:
7880
coder.io.tool_error(f"Error running git log: {e}")
7981
return f"Error running git log: {e}"
8082

83+
8184
git_show_schema = {
8285
"type": "function",
8386
"function": {
@@ -96,6 +99,7 @@ def _execute_git_log(coder, limit=10):
9699
},
97100
}
98101

102+
99103
def _execute_git_show(coder, object="HEAD"):
100104
"""
101105
Show various types of objects (blobs, trees, tags, and commits).
@@ -109,6 +113,7 @@ def _execute_git_show(coder, object="HEAD"):
109113
coder.io.tool_error(f"Error running git show: {e}")
110114
return f"Error running git show: {e}"
111115

116+
112117
git_status_schema = {
113118
"type": "function",
114119
"function": {
@@ -122,6 +127,7 @@ def _execute_git_show(coder, object="HEAD"):
122127
},
123128
}
124129

130+
125131
def _execute_git_status(coder):
126132
"""
127133
Show the working tree status.

0 commit comments

Comments
 (0)