Skip to content

Commit

Permalink
Add blank lines with trailing white spaces fixtures.
Browse files Browse the repository at this point in the history
  • Loading branch information
hoel-bagard committed Feb 9, 2024
1 parent a375a69 commit 579dfb5
Show file tree
Hide file tree
Showing 7 changed files with 593 additions and 526 deletions.
32 changes: 32 additions & 0 deletions crates/ruff_linter/resources/test/fixtures/pycodestyle/E30.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,15 @@ def b():
# end


# no error
def test():
pass

# Wrongly indented comment
pass
# end


# E301
class Class(object):

Expand Down Expand Up @@ -534,6 +543,20 @@ def g():
# end


# E302
class Test:

pass

def method1():
return 1


def method2():
return 22
# end


# E303
def fn():
_ = None
Expand Down Expand Up @@ -648,6 +671,15 @@ def b(self):
# end


# E303
def fn():
pass


pass
# end


# E304
@decorator

Expand Down
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
E30.py:444:5: E301 [*] Expected 1 blank line, found 0
E30.py:453:5: E301 [*] Expected 1 blank line, found 0
|
442 | def func1():
443 | pass
444 | def func2():
451 | def func1():
452 | pass
453 | def func2():
| ^^^ E301
445 | pass
446 | # end
454 | pass
455 | # end
|
= help: Add missing blank line

Safe fix
441 441 |
442 442 | def func1():
443 443 | pass
444 |+
444 445 | def func2():
445 446 | pass
446 447 | # end
450 450 |
451 451 | def func1():
452 452 | pass
453 |+
453 454 | def func2():
454 455 | pass
455 456 | # end

E30.py:455:5: E301 [*] Expected 1 blank line, found 0
E30.py:464:5: E301 [*] Expected 1 blank line, found 0
|
453 | pass
454 | # comment
455 | def fn2():
462 | pass
463 | # comment
464 | def fn2():
| ^^^ E301
456 | pass
457 | # end
465 | pass
466 | # end
|
= help: Add missing blank line

Safe fix
451 451 |
452 452 | def fn1():
453 453 | pass
454 |+
454 455 | # comment
455 456 | def fn2():
456 457 | pass
460 460 |
461 461 | def fn1():
462 462 | pass
463 |+
463 464 | # comment
464 465 | def fn2():
465 466 | pass


Loading

0 comments on commit 579dfb5

Please sign in to comment.