From 4decd8911b7042b052e8b26df2804b276bde376d Mon Sep 17 00:00:00 2001 From: konstin Date: Fri, 27 Oct 2023 12:52:22 +0200 Subject: [PATCH] Add test to track formatter preview style for #8279 Track the preview style of https://github.com/astral-sh/ruff/issues/8279 / https://github.com/psf/black/pull/3964 --- .../resources/test/fixtures/ruff/preview.py | 11 ++++++ .../tests/snapshots/format@preview.py.snap | 34 ++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/crates/ruff_python_formatter/resources/test/fixtures/ruff/preview.py b/crates/ruff_python_formatter/resources/test/fixtures/ruff/preview.py index 111dc0cf5e63c..b3fd595a9b47d 100644 --- a/crates/ruff_python_formatter/resources/test/fixtures/ruff/preview.py +++ b/crates/ruff_python_formatter/resources/test/fixtures/ruff/preview.py @@ -64,3 +64,14 @@ def f(): self._cached_dependencies_by_level: dict[ int, list[DependencyCacheKey] ] = collections.defaultdict(list) + + +# https://github.com/astral-sh/ruff/issues/8279 +# https://github.com/psf/black/pull/3964 +f( + [ + 1, + 2, + 3, + ] +) \ No newline at end of file diff --git a/crates/ruff_python_formatter/tests/snapshots/format@preview.py.snap b/crates/ruff_python_formatter/tests/snapshots/format@preview.py.snap index b803c6f3fd74b..f1f40612cd8ce 100644 --- a/crates/ruff_python_formatter/tests/snapshots/format@preview.py.snap +++ b/crates/ruff_python_formatter/tests/snapshots/format@preview.py.snap @@ -70,7 +70,17 @@ def f(): self._cached_dependencies_by_level: dict[ int, list[DependencyCacheKey] ] = collections.defaultdict(list) -``` + + +# https://github.com/astral-sh/ruff/issues/8279 +# https://github.com/psf/black/pull/3964 +f( + [ + 1, + 2, + 3, + ] +)``` ## Outputs ### Output 1 @@ -149,6 +159,17 @@ def f(): self._cached_dependencies_by_level: dict[ int, list[DependencyCacheKey] ] = collections.defaultdict(list) + + +# https://github.com/astral-sh/ruff/issues/8279 +# https://github.com/psf/black/pull/3964 +f( + [ + 1, + 2, + 3, + ] +) ``` @@ -227,6 +248,17 @@ def f(): self._cached_dependencies_by_level: dict[ int, list[DependencyCacheKey] ] = collections.defaultdict(list) + + +# https://github.com/astral-sh/ruff/issues/8279 +# https://github.com/psf/black/pull/3964 +f( + [ + 1, + 2, + 3, + ] +) ```