Skip to content

Commit

Permalink
add wrongly indented comment test
Browse files Browse the repository at this point in the history
  • Loading branch information
hoel-bagard committed Feb 6, 2024
1 parent db137d9 commit 85302d5
Show file tree
Hide file tree
Showing 7 changed files with 576 additions and 534 deletions.
24 changes: 24 additions & 0 deletions crates/ruff_linter/resources/test/fixtures/pycodestyle/E30.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,17 @@ def a(self): pass
# end


# no error
class Test:
def a():
pass
# wrongly indented comment

def b():
pass
# end


# E301
class Class(object):

Expand Down Expand Up @@ -624,6 +635,19 @@ def test(self): pass
# end


# E303
class Test:
def a(self):
pass

# wrongly indented comment


def b(self):
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:433:5: E301 [*] Expected 1 blank line, found 0
E30.py:444:5: E301 [*] Expected 1 blank line, found 0
|
431 | def func1():
432 | pass
433 | def func2():
442 | def func1():
443 | pass
444 | def func2():
| ^^^ E301
434 | pass
435 | # end
445 | pass
446 | # end
|
= help: Add missing blank line(s)

Safe fix
430 430 |
431 431 | def func1():
432 432 | pass
433 |+
433 434 | def func2():
434 435 | pass
435 436 | # end
441 441 |
442 442 | def func1():
443 443 | pass
444 |+
444 445 | def func2():
445 446 | pass
446 447 | # end

E30.py:444:5: E301 [*] Expected 1 blank line, found 0
E30.py:455:5: E301 [*] Expected 1 blank line, found 0
|
442 | pass
443 | # comment
444 | def fn2():
453 | pass
454 | # comment
455 | def fn2():
| ^^^ E301
445 | pass
446 | # end
456 | pass
457 | # end
|
= help: Add missing blank line(s)

Safe fix
440 440 |
441 441 | def fn1():
442 442 | pass
443 |+
443 444 | # comment
444 445 | def fn2():
445 446 | pass
451 451 |
452 452 | def fn1():
453 453 | pass
454 |+
454 455 | # comment
455 456 | def fn2():
456 457 | pass


Loading

0 comments on commit 85302d5

Please sign in to comment.