forked from astral-sh/ruff
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…sh#11381) ## Summary Changes `future-rewritable-type-annotation` (`FA100`) message to be less confusing. Uses phrasing from the rule documentation to be consistent. For example, ``` from_typing_import.py:5:13: FA100 Add `from __future__ import annotations` to rewrite `typing.List` more succinctly ``` Closes astral-sh#10573. ## Test Plan `cargo nextest run`
- Loading branch information
Showing
6 changed files
with
8 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
...tations/snapshots/ruff_linter__rules__flake8_future_annotations__tests__edge_case.py.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/flake8_future_annotations/mod.rs | ||
--- | ||
edge_case.py:5:13: FA100 Missing `from __future__ import annotations`, but uses `typing.List` | ||
edge_case.py:5:13: FA100 Add `from __future__ import annotations` to simplify `typing.List` | ||
| | ||
5 | def main(_: List[int]) -> None: | ||
| ^^^^ FA100 | ||
6 | a_list: t.List[str] = [] | ||
7 | a_list.append("hello") | ||
| | ||
|
||
edge_case.py:6:13: FA100 Missing `from __future__ import annotations`, but uses `typing.List` | ||
edge_case.py:6:13: FA100 Add `from __future__ import annotations` to simplify `typing.List` | ||
| | ||
5 | def main(_: List[int]) -> None: | ||
6 | a_list: t.List[str] = [] | ||
| ^^^^^^ FA100 | ||
7 | a_list.append("hello") | ||
| | ||
|
||
|
4 changes: 1 addition & 3 deletions
4
...napshots/ruff_linter__rules__flake8_future_annotations__tests__from_typing_import.py.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/flake8_future_annotations/mod.rs | ||
--- | ||
from_typing_import.py:5:13: FA100 Missing `from __future__ import annotations`, but uses `typing.List` | ||
from_typing_import.py:5:13: FA100 Add `from __future__ import annotations` to simplify `typing.List` | ||
| | ||
4 | def main() -> None: | ||
5 | a_list: List[str] = [] | ||
| ^^^^ FA100 | ||
6 | a_list.append("hello") | ||
| | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
...ons/snapshots/ruff_linter__rules__flake8_future_annotations__tests__import_typing.py.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/flake8_future_annotations/mod.rs | ||
--- | ||
import_typing.py:5:13: FA100 Missing `from __future__ import annotations`, but uses `typing.List` | ||
import_typing.py:5:13: FA100 Add `from __future__ import annotations` to simplify `typing.List` | ||
| | ||
4 | def main() -> None: | ||
5 | a_list: typing.List[str] = [] | ||
| ^^^^^^^^^^^ FA100 | ||
6 | a_list.append("hello") | ||
| | ||
|
||
|
4 changes: 1 addition & 3 deletions
4
.../snapshots/ruff_linter__rules__flake8_future_annotations__tests__import_typing_as.py.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/flake8_future_annotations/mod.rs | ||
--- | ||
import_typing_as.py:5:13: FA100 Missing `from __future__ import annotations`, but uses `typing.List` | ||
import_typing_as.py:5:13: FA100 Add `from __future__ import annotations` to simplify `typing.List` | ||
| | ||
4 | def main() -> None: | ||
5 | a_list: t.List[str] = [] | ||
| ^^^^^^ FA100 | ||
6 | a_list.append("hello") | ||
| | ||
|
||
|