This commit is contained in:
mrT23
2023-08-22 16:32:22 +03:00
parent 36e5e5a17e
commit 9157fa670e
5 changed files with 5 additions and 5 deletions

View File

@ -36,7 +36,7 @@ class BitbucketProvider:
except Exception: except Exception:
return "" return ""
def publish_code_suggestions(self, code_suggestions: list): def publish_code_suggestions(self, code_suggestions: list) -> bool:
""" """
Publishes code suggestions as comments on the PR. Publishes code suggestions as comments on the PR.
""" """

View File

@ -54,7 +54,7 @@ class GitProvider(ABC):
pass pass
@abstractmethod @abstractmethod
def publish_code_suggestions(self, code_suggestions: list): def publish_code_suggestions(self, code_suggestions: list) -> bool:
pass pass
@abstractmethod @abstractmethod

View File

@ -166,7 +166,7 @@ class GithubProvider(GitProvider):
def publish_inline_comments(self, comments: list[dict]): def publish_inline_comments(self, comments: list[dict]):
self.pr.create_review(commit=self.last_commit_id, comments=comments) self.pr.create_review(commit=self.last_commit_id, comments=comments)
def publish_code_suggestions(self, code_suggestions: list): def publish_code_suggestions(self, code_suggestions: list) -> bool:
""" """
Publishes code suggestions as comments on the PR. Publishes code suggestions as comments on the PR.
""" """

View File

@ -195,7 +195,7 @@ class GitLabProvider(GitProvider):
f'No relevant diff found for {relevant_file} {relevant_line_in_file}. Falling back to last diff.') f'No relevant diff found for {relevant_file} {relevant_line_in_file}. Falling back to last diff.')
return self.last_diff # fallback to last_diff if no relevant diff is found return self.last_diff # fallback to last_diff if no relevant diff is found
def publish_code_suggestions(self, code_suggestions: list): def publish_code_suggestions(self, code_suggestions: list) -> bool:
for suggestion in code_suggestions: for suggestion in code_suggestions:
try: try:
body = suggestion['body'] body = suggestion['body']

View File

@ -130,7 +130,7 @@ class LocalGitProvider(GitProvider):
relevant_lines_start: int, relevant_lines_end: int): relevant_lines_start: int, relevant_lines_end: int):
raise NotImplementedError('Publishing code suggestions is not implemented for the local git provider') raise NotImplementedError('Publishing code suggestions is not implemented for the local git provider')
def publish_code_suggestions(self, code_suggestions: list): def publish_code_suggestions(self, code_suggestions: list) -> bool:
raise NotImplementedError('Publishing code suggestions is not implemented for the local git provider') raise NotImplementedError('Publishing code suggestions is not implemented for the local git provider')
def publish_labels(self, labels): def publish_labels(self, labels):