diff --git a/api/analyzers/csharp/__init__.py b/api/analyzers/csharp/__init__.py index e69de29..8b13789 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 77f1cc9..fd4948b 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 354f5c6..16fc57e 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 8c3330e..f324eca 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 aeaaf50..e8b4b3c 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 0000000..c4464a3 --- /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_newlines(): + 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" + )