From afb8932b2f05757e9ebe832ed80fe78e34e684b2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 10 Mar 2026 21:24:55 +0000 Subject: [PATCH 1/3] Initial plan From 4e566f51b4f8a932ede4a57bac0204baecfb36cc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 10 Mar 2026 21:27:41 +0000 Subject: [PATCH 2/3] test: cover api trailing newline cleanup Co-authored-by: gkorland <753206+gkorland@users.noreply.github.com> --- api/analyzers/csharp/__init__.py | 1 + api/entities/entity.py | 2 +- api/index.py | 2 +- api/llm.py | 2 +- api/prompts.py | 2 +- tests/test_api_trailing_newlines.py | 20 ++++++++++++++++++++ 6 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 tests/test_api_trailing_newlines.py diff --git a/api/analyzers/csharp/__init__.py b/api/analyzers/csharp/__init__.py index e69de29b..8b137891 100644 --- a/api/analyzers/csharp/__init__.py +++ b/api/analyzers/csharp/__init__.py @@ -0,0 +1 @@ + diff --git a/api/entities/entity.py b/api/entities/entity.py index 77f1cc97..fd4948b4 100644 --- a/api/entities/entity.py +++ b/api/entities/entity.py @@ -28,4 +28,4 @@ def resolved_symbol(self, f: Callable[[str, Node], list[Self]]): for key, symbols in self.symbols.items(): for symbol in symbols: for resolved_symbol in f(key, symbol.symbol): - symbol.add_resolve_symbol(resolved_symbol) \ No newline at end of file + symbol.add_resolve_symbol(resolved_symbol) diff --git a/api/index.py b/api/index.py index 354f5c6d..16fc57e5 100644 --- a/api/index.py +++ b/api/index.py @@ -517,4 +517,4 @@ def list_commits(): 'commits': commits } - return jsonify(response), 200 \ No newline at end of file + return jsonify(response), 200 diff --git a/api/llm.py b/api/llm.py index 8c3330e9..f324eca8 100644 --- a/api/llm.py +++ b/api/llm.py @@ -264,4 +264,4 @@ def ask(repo_name: str, question: str) -> str: response = chat.send_message(question) logging.debug(f"Response: {response}") print(f"Response: {response['response']}") - return response['response'] \ No newline at end of file + return response['response'] diff --git a/api/prompts.py b/api/prompts.py index aeaaf504..e8b4b3c7 100644 --- a/api/prompts.py +++ b/api/prompts.py @@ -110,4 +110,4 @@ **Question:** {question} -**Your helpful answer:**""" \ No newline at end of file +**Your helpful answer:**""" diff --git a/tests/test_api_trailing_newlines.py b/tests/test_api_trailing_newlines.py new file mode 100644 index 00000000..d4fffb49 --- /dev/null +++ b/tests/test_api_trailing_newlines.py @@ -0,0 +1,20 @@ +from pathlib import Path + + +API_FILES_WITH_REQUIRED_TRAILING_NEWLINE = [ + "api/analyzers/csharp/__init__.py", + "api/entities/entity.py", + "api/index.py", + "api/llm.py", + "api/prompts.py", +] + + +def test_reported_api_files_end_with_trailing_newline(): + repo_root = Path(__file__).resolve().parent.parent + + for relative_path in API_FILES_WITH_REQUIRED_TRAILING_NEWLINE: + file_path = repo_root / relative_path + assert file_path.read_bytes().endswith(b"\n"), ( + f"{relative_path} must end with a trailing newline" + ) From d78eafc8b768b98ed2e82391db399288f5eb3755 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 10 Mar 2026 21:29:00 +0000 Subject: [PATCH 3/3] chore: finalize api trailing newline cleanup Co-authored-by: gkorland <753206+gkorland@users.noreply.github.com> --- tests/test_api_trailing_newlines.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_api_trailing_newlines.py b/tests/test_api_trailing_newlines.py index d4fffb49..c4464a30 100644 --- a/tests/test_api_trailing_newlines.py +++ b/tests/test_api_trailing_newlines.py @@ -10,7 +10,7 @@ ] -def test_reported_api_files_end_with_trailing_newline(): +def test_reported_api_files_end_with_trailing_newlines(): repo_root = Path(__file__).resolve().parent.parent for relative_path in API_FILES_WITH_REQUIRED_TRAILING_NEWLINE: