Skip to content

Commit

Permalink
Add test and update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
hoel-bagard committed Apr 13, 2024
1 parent 8af0184 commit 758835e
Show file tree
Hide file tree
Showing 6 changed files with 431 additions and 400 deletions.
11 changes: 11 additions & 0 deletions crates/ruff_linter/resources/test/fixtures/pycodestyle/E30.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,17 @@ class B: ...
# end


# E302
@overload
def fn(a: int) -> int: ...
@overload
def fn(a: str) -> str: ...

def fn(a: int | str) -> int | str:
...
# end


# E303
def fn():
_ = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,24 @@ E30.py:632:1: E302 [*] Expected 2 blank lines, found 0
633 |+
632 634 | class B: ...
633 635 | # end
634 636 |
634 636 |

E30.py:642:1: E302 [*] Expected 2 blank lines, found 1
|
640 | def fn(a: str) -> str: ...
641 |
642 | def fn(a: int | str) -> int | str:
| ^^^ E302
643 | ...
644 | # end
|
= help: Add missing blank line(s)

Safe fix
639 639 | @overload
640 640 | def fn(a: str) -> str: ...
641 641 |
642 |+
642 643 | def fn(a: int | str) -> int | str:
643 644 | ...
644 645 | # end

0 comments on commit 758835e

Please sign in to comment.