From 53b7f53cf043a0bd9f02af2fbaa4c87245168665 Mon Sep 17 00:00:00 2001 From: Micha Reiser Date: Fri, 31 May 2024 14:00:54 +0200 Subject: [PATCH] Add trailing comment before end of file --- .../ruff/statement/stub_functions_trailing_comments.py | 3 +++ ...t@statement__stub_functions_trailing_comments.py.snap | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/stub_functions_trailing_comments.py b/crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/stub_functions_trailing_comments.py index e83c4250816d6..04ab35d22e774 100644 --- a/crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/stub_functions_trailing_comments.py +++ b/crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/stub_functions_trailing_comments.py @@ -23,3 +23,6 @@ def foo(self) -> None: ... # comment 5 def baz(self) -> None: return None + +def foo(self) -> None: ... +# comment 5 diff --git a/crates/ruff_python_formatter/tests/snapshots/format@statement__stub_functions_trailing_comments.py.snap b/crates/ruff_python_formatter/tests/snapshots/format@statement__stub_functions_trailing_comments.py.snap index 23434a04e5747..39b3ecb94b1a8 100644 --- a/crates/ruff_python_formatter/tests/snapshots/format@statement__stub_functions_trailing_comments.py.snap +++ b/crates/ruff_python_formatter/tests/snapshots/format@statement__stub_functions_trailing_comments.py.snap @@ -29,6 +29,9 @@ def foo(self) -> None: ... # comment 5 def baz(self) -> None: return None + +def foo(self) -> None: ... +# comment 5 ``` ## Output @@ -65,4 +68,10 @@ def baz(self) -> None: def foo(self) -> None: ... # comment 5 def baz(self) -> None: return None + + +def foo(self) -> None: ... + + +# comment 5 ```