small addition

This commit is contained in:
Hussam.lawen
2023-07-14 22:45:07 +03:00
parent ae63833043
commit 3f75b14ba3
2 changed files with 9 additions and 1 deletions

View File

@ -62,8 +62,14 @@ class GithubProvider:
if relevant_line_in_file in line:
position = i
break
elif relevant_line_in_file[0] == '+' and relevant_line_in_file[1:] in line:
# The model often adds a '+' to the beginning of the relevant_line_in_file even if originally
# it's a context line
position = i
break
if position == -1:
logging.info(f"Could not find position for {relevant_file} {relevant_line_in_file}")
if settings.config.verbosity_level >= 2:
logging.info(f"Could not find position for {relevant_file} {relevant_line_in_file}")
else:
path = relevant_file.strip()
self.pr.create_review_comment(body=body, commit_id=self.last_commit_id, path=path, position=position)

View File

@ -136,6 +136,8 @@ class GitLabProvider(GitProvider):
edit_type = self.get_edit_type(line)
break
elif relevant_line_in_file[0] == '+' and relevant_line_in_file[1:] in line:
# The model often adds a '+' to the beginning of the relevant_line_in_file even if originally
# it's a context line
found = True
edit_type = self.get_edit_type(line)
break