From 5af0966057fef24aa49699e89d934f20f55a81ed Mon Sep 17 00:00:00 2001 From: Dhruv Manilawala Date: Mon, 28 Oct 2024 11:46:05 +0530 Subject: [PATCH] Remove unreferenced snapshots (#13958) --- ...e-checking-block_quote_annotations.py.snap | 4 - ...ird-party-import_quote_annotations.py.snap | 425 ------------------ ...ules__pydocstyle__tests__D415_D415.py.snap | 37 -- .../tests/snapshots/format.snap | 50 --- 4 files changed, 516 deletions(-) delete mode 100644 crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__quote_runtime-import-in-type-checking-block_quote_annotations.py.snap delete mode 100644 crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__quote_typing-only-third-party-import_quote_annotations.py.snap delete mode 100644 crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D415_D415.py.snap delete mode 100644 crates/ruff_python_formatter/tests/snapshots/format.snap diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__quote_runtime-import-in-type-checking-block_quote_annotations.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__quote_runtime-import-in-type-checking-block_quote_annotations.py.snap deleted file mode 100644 index 6c5ead2742..0000000000 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__quote_runtime-import-in-type-checking-block_quote_annotations.py.snap +++ /dev/null @@ -1,4 +0,0 @@ ---- -source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs ---- - diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__quote_typing-only-third-party-import_quote_annotations.py.snap b/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__quote_typing-only-third-party-import_quote_annotations.py.snap deleted file mode 100644 index a890780004..0000000000 --- a/crates/ruff_linter/src/rules/flake8_type_checking/snapshots/ruff_linter__rules__flake8_type_checking__tests__quote_typing-only-third-party-import_quote_annotations.py.snap +++ /dev/null @@ -1,425 +0,0 @@ ---- -source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs ---- -quote_annotations.py:2:44: TCH002 [*] Move third-party import `django.contrib.auth.models.AbstractBaseUser` into a type-checking block - | -1 | def f(): -2 | from django.contrib.auth.models import AbstractBaseUser - | ^^^^^^^^^^^^^^^^ TCH002 -3 | -4 | def test_remove_inner_quotes_double(self, user: AbstractBaseUser["int"], view: "type[CondorBaseViewSet]"): - | - = help: Move into type-checking block - -ℹ Unsafe fix -1 |-def f(): - 1 |+from typing import TYPE_CHECKING - 2 |+ - 3 |+if TYPE_CHECKING: -2 4 | from django.contrib.auth.models import AbstractBaseUser - 5 |+def f(): -3 6 | -4 |- def test_remove_inner_quotes_double(self, user: AbstractBaseUser["int"], view: "type[CondorBaseViewSet]"): - 7 |+ def test_remove_inner_quotes_double(self, user: "AbstractBaseUser[int]", view: "type[CondorBaseViewSet]"): -5 8 | pass -6 9 | -7 10 | - -quote_annotations.py:9:44: TCH002 [*] Move third-party import `django.contrib.auth.models.AbstractBaseUser` into a type-checking block - | - 8 | def f(): - 9 | from django.contrib.auth.models import AbstractBaseUser - | ^^^^^^^^^^^^^^^^ TCH002 -10 | -11 | def test_remove_inner_quotes_single(self, user: AbstractBaseUser['int']): - | - = help: Move into type-checking block - -ℹ Unsafe fix - 1 |+from typing import TYPE_CHECKING - 2 |+ - 3 |+if TYPE_CHECKING: - 4 |+ from django.contrib.auth.models import AbstractBaseUser -1 5 | def f(): -2 6 | from django.contrib.auth.models import AbstractBaseUser -3 7 | --------------------------------------------------------------------------------- -6 10 | -7 11 | -8 12 | def f(): -9 |- from django.contrib.auth.models import AbstractBaseUser -10 13 | -11 |- def test_remove_inner_quotes_single(self, user: AbstractBaseUser['int']): - 14 |+ def test_remove_inner_quotes_single(self, user: "AbstractBaseUser[int]"): -12 15 | pass -13 16 | -14 17 | - -quote_annotations.py:16:44: TCH002 [*] Move third-party import `django.contrib.auth.models.AbstractBaseUser` into a type-checking block - | -15 | def f(): -16 | from django.contrib.auth.models import AbstractBaseUser - | ^^^^^^^^^^^^^^^^ TCH002 -17 | -18 | def test_remove_inner_quotes_mixed(self, user: AbstractBaseUser['int', "str"]): - | - = help: Move into type-checking block - -ℹ Unsafe fix - 1 |+from typing import TYPE_CHECKING - 2 |+ - 3 |+if TYPE_CHECKING: - 4 |+ from django.contrib.auth.models import AbstractBaseUser -1 5 | def f(): -2 6 | from django.contrib.auth.models import AbstractBaseUser -3 7 | --------------------------------------------------------------------------------- -13 17 | -14 18 | -15 19 | def f(): -16 |- from django.contrib.auth.models import AbstractBaseUser -17 20 | -18 |- def test_remove_inner_quotes_mixed(self, user: AbstractBaseUser['int', "str"]): - 21 |+ def test_remove_inner_quotes_mixed(self, user: "AbstractBaseUser[int, str]"): -19 22 | pass -20 23 | -21 24 | - -quote_annotations.py:25:44: TCH002 [*] Move third-party import `django.contrib.auth.models.AbstractBaseUser` into a type-checking block - | -23 | from typing import Annotated, Literal -24 | -25 | from django.contrib.auth.models import AbstractBaseUser - | ^^^^^^^^^^^^^^^^ TCH002 -26 | -27 | def test_literal_annotation_args_contain_quotes(self, type1: AbstractBaseUser[Literal["user", "admin"], Annotated["int", "1", 2]]): - | - = help: Move into type-checking block - -ℹ Unsafe fix - 1 |+from typing import TYPE_CHECKING - 2 |+ - 3 |+if TYPE_CHECKING: - 4 |+ from django.contrib.auth.models import AbstractBaseUser -1 5 | def f(): -2 6 | from django.contrib.auth.models import AbstractBaseUser -3 7 | --------------------------------------------------------------------------------- -22 26 | def f(): -23 27 | from typing import Annotated, Literal -24 28 | -25 |- from django.contrib.auth.models import AbstractBaseUser -26 29 | -27 |- def test_literal_annotation_args_contain_quotes(self, type1: AbstractBaseUser[Literal["user", "admin"], Annotated["int", "1", 2]]): - 30 |+ def test_literal_annotation_args_contain_quotes(self, type1: "AbstractBaseUser[Literal['user', 'admin'], Annotated[int, '1', 2]]"): -28 31 | pass -29 32 | -30 33 | - -quote_annotations.py:34:44: TCH002 [*] Move third-party import `django.contrib.auth.models.AbstractBaseUser` into a type-checking block - | -32 | from typing import Literal -33 | -34 | from django.contrib.auth.models import AbstractBaseUser - | ^^^^^^^^^^^^^^^^ TCH002 -35 | -36 | def test_union_contain_inner_quotes(self, type1: AbstractBaseUser["int" | Literal["int"]]): - | - = help: Move into type-checking block - -ℹ Unsafe fix - 1 |+from typing import TYPE_CHECKING - 2 |+ - 3 |+if TYPE_CHECKING: - 4 |+ from django.contrib.auth.models import AbstractBaseUser -1 5 | def f(): -2 6 | from django.contrib.auth.models import AbstractBaseUser -3 7 | --------------------------------------------------------------------------------- -31 35 | def f(): -32 36 | from typing import Literal -33 37 | -34 |- from django.contrib.auth.models import AbstractBaseUser -35 38 | -36 |- def test_union_contain_inner_quotes(self, type1: AbstractBaseUser["int" | Literal["int"]]): - 39 |+ def test_union_contain_inner_quotes(self, type1: "AbstractBaseUser[int | Literal['int']]"): -37 40 | pass -38 41 | -39 42 | - -quote_annotations.py:43:44: TCH002 [*] Move third-party import `django.contrib.auth.models.AbstractBaseUser` into a type-checking block - | -41 | from typing import Literal -42 | -43 | from django.contrib.auth.models import AbstractBaseUser - | ^^^^^^^^^^^^^^^^ TCH002 -44 | -45 | def test_inner_literal_mixed_quotes(user: AbstractBaseUser[Literal['user', "admin"]]): - | - = help: Move into type-checking block - -ℹ Unsafe fix - 1 |+from typing import TYPE_CHECKING - 2 |+ - 3 |+if TYPE_CHECKING: - 4 |+ from django.contrib.auth.models import AbstractBaseUser -1 5 | def f(): -2 6 | from django.contrib.auth.models import AbstractBaseUser -3 7 | --------------------------------------------------------------------------------- -40 44 | def f(): -41 45 | from typing import Literal -42 46 | -43 |- from django.contrib.auth.models import AbstractBaseUser -44 47 | -45 |- def test_inner_literal_mixed_quotes(user: AbstractBaseUser[Literal['user', "admin"]]): - 48 |+ def test_inner_literal_mixed_quotes(user: "AbstractBaseUser[Literal['user', 'admin']]"): -46 49 | pass -47 50 | -48 51 | - -quote_annotations.py:52:44: TCH002 [*] Move third-party import `django.contrib.auth.models.AbstractBaseUser` into a type-checking block - | -50 | from typing import Literal -51 | -52 | from django.contrib.auth.models import AbstractBaseUser - | ^^^^^^^^^^^^^^^^ TCH002 -53 | -54 | def test_inner_literal_single_quote(user: AbstractBaseUser[Literal['int'], str]): - | - = help: Move into type-checking block - -ℹ Unsafe fix - 1 |+from typing import TYPE_CHECKING - 2 |+ - 3 |+if TYPE_CHECKING: - 4 |+ from django.contrib.auth.models import AbstractBaseUser -1 5 | def f(): -2 6 | from django.contrib.auth.models import AbstractBaseUser -3 7 | --------------------------------------------------------------------------------- -49 53 | def f(): -50 54 | from typing import Literal -51 55 | -52 |- from django.contrib.auth.models import AbstractBaseUser -53 56 | -54 |- def test_inner_literal_single_quote(user: AbstractBaseUser[Literal['int'], str]): - 57 |+ def test_inner_literal_single_quote(user: "AbstractBaseUser[Literal['int'], str]"): -55 58 | pass -56 59 | -57 60 | - -quote_annotations.py:61:44: TCH002 [*] Move third-party import `django.contrib.auth.models.AbstractBaseUser` into a type-checking block - | -59 | from typing import Literal -60 | -61 | from django.contrib.auth.models import AbstractBaseUser - | ^^^^^^^^^^^^^^^^ TCH002 -62 | -63 | def test_mixed_quotes_literal(user: AbstractBaseUser[Literal['user'], "int"]): - | - = help: Move into type-checking block - -ℹ Unsafe fix - 1 |+from typing import TYPE_CHECKING - 2 |+ - 3 |+if TYPE_CHECKING: - 4 |+ from django.contrib.auth.models import AbstractBaseUser -1 5 | def f(): -2 6 | from django.contrib.auth.models import AbstractBaseUser -3 7 | --------------------------------------------------------------------------------- -58 62 | def f(): -59 63 | from typing import Literal -60 64 | -61 |- from django.contrib.auth.models import AbstractBaseUser -62 65 | -63 |- def test_mixed_quotes_literal(user: AbstractBaseUser[Literal['user'], "int"]): - 66 |+ def test_mixed_quotes_literal(user: "AbstractBaseUser[Literal['user'], int]"): -64 67 | pass -65 68 | -66 69 | - -quote_annotations.py:70:44: TCH002 [*] Move third-party import `django.contrib.auth.models.AbstractBaseUser` into a type-checking block - | -68 | from typing import Annotated, Literal -69 | -70 | from django.contrib.auth.models import AbstractBaseUser - | ^^^^^^^^^^^^^^^^ TCH002 -71 | -72 | def test_annotated_literal_mixed_quotes(user: AbstractBaseUser[Annotated[str, "max_length=20", Literal['user', "admin"]]]): - | - = help: Move into type-checking block - -ℹ Unsafe fix - 1 |+from typing import TYPE_CHECKING - 2 |+ - 3 |+if TYPE_CHECKING: - 4 |+ from django.contrib.auth.models import AbstractBaseUser -1 5 | def f(): -2 6 | from django.contrib.auth.models import AbstractBaseUser -3 7 | --------------------------------------------------------------------------------- -67 71 | def f(): -68 72 | from typing import Annotated, Literal -69 73 | -70 |- from django.contrib.auth.models import AbstractBaseUser -71 74 | -72 |- def test_annotated_literal_mixed_quotes(user: AbstractBaseUser[Annotated[str, "max_length=20", Literal['user', "admin"]]]): - 75 |+ def test_annotated_literal_mixed_quotes(user: "AbstractBaseUser[Annotated[str, 'max_length=20', Literal['user', 'admin']]]"): -73 76 | pass -74 77 | -75 78 | - -quote_annotations.py:79:44: TCH002 [*] Move third-party import `django.contrib.auth.models.AbstractBaseUser` into a type-checking block - | -77 | from typing import Literal, Union -78 | -79 | from django.contrib.auth.models import AbstractBaseUser - | ^^^^^^^^^^^^^^^^ TCH002 -80 | -81 | def test_union_literal_mixed_quotes(user: AbstractBaseUser[Union[Literal['active', "inactive"], str]]): - | - = help: Move into type-checking block - -ℹ Unsafe fix - 1 |+from typing import TYPE_CHECKING - 2 |+ - 3 |+if TYPE_CHECKING: - 4 |+ from django.contrib.auth.models import AbstractBaseUser -1 5 | def f(): -2 6 | from django.contrib.auth.models import AbstractBaseUser -3 7 | --------------------------------------------------------------------------------- -76 80 | def f(): -77 81 | from typing import Literal, Union -78 82 | -79 |- from django.contrib.auth.models import AbstractBaseUser -80 83 | -81 |- def test_union_literal_mixed_quotes(user: AbstractBaseUser[Union[Literal['active', "inactive"], str]]): - 84 |+ def test_union_literal_mixed_quotes(user: "AbstractBaseUser[Union[Literal['active', 'inactive'], str]]"): -82 85 | pass -83 86 | -84 87 | - -quote_annotations.py:88:44: TCH002 [*] Move third-party import `django.contrib.auth.models.AbstractBaseUser` into a type-checking block - | -86 | from typing import Callable, Literal -87 | -88 | from django.contrib.auth.models import AbstractBaseUser - | ^^^^^^^^^^^^^^^^ TCH002 -89 | -90 | def test_callable_literal_mixed_quotes(callable_fn: AbstractBaseUser[Callable[["int", Literal['admin', "user"]], 'bool']]): - | - = help: Move into type-checking block - -ℹ Unsafe fix - 1 |+from typing import TYPE_CHECKING - 2 |+ - 3 |+if TYPE_CHECKING: - 4 |+ from django.contrib.auth.models import AbstractBaseUser -1 5 | def f(): -2 6 | from django.contrib.auth.models import AbstractBaseUser -3 7 | --------------------------------------------------------------------------------- -85 89 | def f(): -86 90 | from typing import Callable, Literal -87 91 | -88 |- from django.contrib.auth.models import AbstractBaseUser -89 92 | -90 |- def test_callable_literal_mixed_quotes(callable_fn: AbstractBaseUser[Callable[["int", Literal['admin', "user"]], 'bool']]): - 93 |+ def test_callable_literal_mixed_quotes(callable_fn: "AbstractBaseUser[Callable[[int, Literal[admin, user]], bool]]"): -91 94 | pass -92 95 | -93 96 | - -quote_annotations.py:97:44: TCH002 [*] Move third-party import `django.contrib.auth.models.AbstractBaseUser` into a type-checking block - | -95 | from typing import Annotated, Callable, Literal -96 | -97 | from django.contrib.auth.models import AbstractBaseUser - | ^^^^^^^^^^^^^^^^ TCH002 -98 | -99 | def test_callable_annotated_literal(callable_fn: AbstractBaseUser[Callable[[int, Annotated[str, Literal['active', "inactive"]]], bool]]): - | - = help: Move into type-checking block - -ℹ Unsafe fix - 1 |+from typing import TYPE_CHECKING - 2 |+ - 3 |+if TYPE_CHECKING: - 4 |+ from django.contrib.auth.models import AbstractBaseUser -1 5 | def f(): -2 6 | from django.contrib.auth.models import AbstractBaseUser -3 7 | --------------------------------------------------------------------------------- -94 98 | def f(): -95 99 | from typing import Annotated, Callable, Literal -96 100 | -97 |- from django.contrib.auth.models import AbstractBaseUser -98 101 | -99 |- def test_callable_annotated_literal(callable_fn: AbstractBaseUser[Callable[[int, Annotated[str, Literal['active', "inactive"]]], bool]]): - 102 |+ def test_callable_annotated_literal(callable_fn: "AbstractBaseUser[Callable[[int, Annotated[str, Literal[active, inactive]]], bool]]"): -100 103 | pass -101 104 | -102 105 | - -quote_annotations.py:120:37: TCH002 [*] Move third-party import `django.contrib.auth.models` into a type-checking block - | -118 | from typing import literal -119 | -120 | from django.contrib.auth import models - | ^^^^^^ TCH002 -121 | -122 | def test_attribute(arg: models.AbstractBaseUser["int"]): - | - = help: Move into type-checking block - -ℹ Unsafe fix - 1 |+from typing import TYPE_CHECKING - 2 |+ - 3 |+if TYPE_CHECKING: - 4 |+ from django.contrib.auth import models -1 5 | def f(): -2 6 | from django.contrib.auth.models import AbstractBaseUser -3 7 | --------------------------------------------------------------------------------- -117 121 | def f(): -118 122 | from typing import literal -119 123 | -120 |- from django.contrib.auth import models -121 124 | -122 |- def test_attribute(arg: models.AbstractBaseUser["int"]): - 125 |+ def test_attribute(arg: "models.AbstractBaseUser[int]"): -123 126 | pass -124 127 | -125 128 | - -quote_annotations.py:129:37: TCH002 [*] Move third-party import `django.contrib.auth.models` into a type-checking block - | -127 | from typing import Literal -128 | -129 | from django.contrib.auth import models - | ^^^^^^ TCH002 -130 | -131 | def test_attribute_typing_literal(arg: models.AbstractBaseUser[Literal["admin"]]): - | - = help: Move into type-checking block - -ℹ Unsafe fix - 1 |+from typing import TYPE_CHECKING - 2 |+ - 3 |+if TYPE_CHECKING: - 4 |+ from django.contrib.auth import models -1 5 | def f(): -2 6 | from django.contrib.auth.models import AbstractBaseUser -3 7 | --------------------------------------------------------------------------------- -126 130 | def f(): -127 131 | from typing import Literal -128 132 | -129 |- from django.contrib.auth import models -130 133 | -131 |- def test_attribute_typing_literal(arg: models.AbstractBaseUser[Literal["admin"]]): - 134 |+ def test_attribute_typing_literal(arg: "models.AbstractBaseUser[Literal['admin']]"): -132 135 | pass diff --git a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D415_D415.py.snap b/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D415_D415.py.snap deleted file mode 100644 index 1a644bdd36..0000000000 --- a/crates/ruff_linter/src/rules/pydocstyle/snapshots/ruff_linter__rules__pydocstyle__tests__D415_D415.py.snap +++ /dev/null @@ -1,37 +0,0 @@ ---- -source: crates/ruff_linter/src/rules/pydocstyle/mod.rs ---- -D415.py:11:5: D415 First line should end with a period, question mark, or exclamation point - | -10 | def f(): -11 | """Here's a line ending in a colon:""" - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D415 -12 | ... - | - = help: Add closing punctuation - -D415.py:15:5: D415 First line should end with a period, question mark, or exclamation point - | -14 | def f(): -15 | """Here's a line ending in a semi colon;""" - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D415 -16 | ... - | - = help: Add closing punctuation - -D415.py:19:5: D415 [*] First line should end with a period, question mark, or exclamation point - | -18 | def f(): -19 | """Here's a line ending with a whitespace """ - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D415 -20 | ... - | - = help: Add closing punctuation - -ℹ Unsafe fix -16 16 | ... -17 17 | -18 18 | def f(): -19 |- """Here's a line ending with a whitespace """ - 19 |+ """Here's a line ending with a whitespace. """ -20 20 | ... diff --git a/crates/ruff_python_formatter/tests/snapshots/format.snap b/crates/ruff_python_formatter/tests/snapshots/format.snap deleted file mode 100644 index 6f55c55302..0000000000 --- a/crates/ruff_python_formatter/tests/snapshots/format.snap +++ /dev/null @@ -1,50 +0,0 @@ ---- -source: crates/ruff_python_formatter/tests/fixtures.rs -input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/join_implicit_concatenated_string_preserve.py ---- -## Input -```python -"diffent '" 'quote "are fine"' # join - -# More single quotes -"one single'" "two 'single'" ' two "double"' - -# More double quotes -'one double"' 'two "double"' " two 'single'" - -# Equal number of single and double quotes -'two "double"' " two 'single'" - -f"{'Hy \"User\"'}" -``` - -## Outputs -### Output 1 -``` -indent-style = space -line-width = 88 -indent-width = 4 -quote-style = Preserve -line-ending = LineFeed -magic-trailing-comma = Respect -docstring-code = Disabled -docstring-code-line-width = "dynamic" -preview = Enabled -target_version = Py38 -source_type = Python -``` - -```python -"diffent 'quote \"are fine\"" # join - -# More single quotes -"one single'two 'single' two \"double\"" - -# More double quotes -'one double"two "double" two \'single\'' - -# Equal number of single and double quotes -'two "double" two \'single\'' - -f"{'Hy "User"'}" -```