diff --git a/sweepai/core/review_utils.py b/sweepai/core/review_utils.py index d9c1dc7dfc..9d95411122 100644 --- a/sweepai/core/review_utils.py +++ b/sweepai/core/review_utils.py @@ -401,4 +401,16 @@ def review_code_issues_by_file(self, pr_changes: list[PRChange], formatted_pr_ch "messages": [{"role": message.role, "content": message.content} for message in self.messages], "output": "END OF MESSAGES", }) - return code_reviews_by_file \ No newline at end of file + return code_reviews_by_file + +# adds line numbers to a string +def add_line_numbers_to_text(content: str): + content_lines = content.split("\n") + new_content = [f"{i} {line}" for i, line in enumerate(content_lines)] + return "\n".join(new_content) + +if __name__ == "__main__": + test_text = """hello + this is some test text to + be numbered""" + print(add_line_numbers_to_text(test_text)) \ No newline at end of file