Skip to content

Commit d6b829f

Browse files
committed
chore: typecheck git_message.py
typecheck codemcp/git_message.py ```git-revs 8d3994c (Base revision) 90d0efb Add type annotation for revision list variables 0bb8dfd Add type annotation for more list variables in the old format handling HEAD Add type annotation for the final list variable ``` codemcp-id: 224-chore-typecheck-git-message-py ghstack-source-id: 918cce4 Pull-Request-resolved: #215
1 parent 010971e commit d6b829f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

codemcp/git_message.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ def update_commit_message_with_description(
7878
message_after = main_message[end_marker_pos + len(END_MARKER) :]
7979

8080
# Parse the revision list
81-
rev_entries = []
81+
rev_entries: list[str] = []
8282
if rev_list_content:
8383
rev_entries = [
8484
line.strip() for line in rev_list_content.splitlines() if line.strip()
8585
]
8686

8787
# Process rev_entries: replace any HEAD entries with actual commit hash
8888
has_base_revision = False
89-
new_rev_entries = []
89+
new_rev_entries: list[str] = []
9090

9191
for entry in rev_entries:
9292
if "(Base revision)" in entry:
@@ -137,8 +137,8 @@ def update_commit_message_with_description(
137137

138138
if has_head_entry or has_base_revision:
139139
# Old format detected, convert to new format with markers
140-
new_rev_entries = []
141-
filtered_lines = []
140+
new_rev_entries: list[str] = []
141+
filtered_lines: list[str] = []
142142

143143
for line in lines:
144144
if "(Base revision)" in line or line.strip().startswith("HEAD"):
@@ -192,7 +192,7 @@ def update_commit_message_with_description(
192192
else:
193193
# No markers or HEAD entries, handle as normal
194194
if description:
195-
rev_entries = []
195+
rev_entries: list[str] = []
196196

197197
# If we have a commit hash, initialize with base revision
198198
if commit_hash:

0 commit comments

Comments
 (0)