-
Notifications
You must be signed in to change notification settings - Fork 881
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[
pycodestyle
] Do not trigger E3
rules on defs following a functio…
…n/method with a dummy body (#10704)
- Loading branch information
1 parent
cbd5001
commit 670d66f
Showing
8 changed files
with
748 additions
and
612 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
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
120 changes: 69 additions & 51 deletions
120
.../src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E301_E30.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,83 +1,101 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs | ||
--- | ||
E30.py:453:5: E301 [*] Expected 1 blank line, found 0 | ||
E30.py:486:5: E301 [*] Expected 1 blank line, found 0 | ||
| | ||
451 | def func1(): | ||
452 | pass | ||
453 | def func2(): | ||
484 | def func1(): | ||
485 | pass | ||
486 | def func2(): | ||
| ^^^ E301 | ||
454 | pass | ||
455 | # end | ||
487 | pass | ||
488 | # end | ||
| | ||
= help: Add missing blank line | ||
|
||
ℹ Safe fix | ||
450 450 | | ||
451 451 | def func1(): | ||
452 452 | pass | ||
453 |+ | ||
453 454 | def func2(): | ||
454 455 | pass | ||
455 456 | # end | ||
483 483 | | ||
484 484 | def func1(): | ||
485 485 | pass | ||
486 |+ | ||
486 487 | def func2(): | ||
487 488 | pass | ||
488 489 | # end | ||
|
||
E30.py:464:5: E301 [*] Expected 1 blank line, found 0 | ||
E30.py:497:5: E301 [*] Expected 1 blank line, found 0 | ||
| | ||
462 | pass | ||
463 | # comment | ||
464 | def fn2(): | ||
495 | pass | ||
496 | # comment | ||
497 | def fn2(): | ||
| ^^^ E301 | ||
465 | pass | ||
466 | # end | ||
498 | pass | ||
499 | # end | ||
| | ||
= help: Add missing blank line | ||
|
||
ℹ Safe fix | ||
460 460 | | ||
461 461 | def fn1(): | ||
462 462 | pass | ||
463 |+ | ||
463 464 | # comment | ||
464 465 | def fn2(): | ||
465 466 | pass | ||
493 493 | | ||
494 494 | def fn1(): | ||
495 495 | pass | ||
496 |+ | ||
496 497 | # comment | ||
497 498 | def fn2(): | ||
498 499 | pass | ||
|
||
E30.py:474:5: E301 [*] Expected 1 blank line, found 0 | ||
E30.py:507:5: E301 [*] Expected 1 blank line, found 0 | ||
| | ||
473 | columns = [] | ||
474 | @classmethod | ||
506 | columns = [] | ||
507 | @classmethod | ||
| ^ E301 | ||
475 | def cls_method(cls) -> None: | ||
476 | pass | ||
508 | def cls_method(cls) -> None: | ||
509 | pass | ||
| | ||
= help: Add missing blank line | ||
|
||
ℹ Safe fix | ||
471 471 | """Class for minimal repo.""" | ||
472 472 | | ||
473 473 | columns = [] | ||
474 |+ | ||
474 475 | @classmethod | ||
475 476 | def cls_method(cls) -> None: | ||
476 477 | pass | ||
504 504 | """Class for minimal repo.""" | ||
505 505 | | ||
506 506 | columns = [] | ||
507 |+ | ||
507 508 | @classmethod | ||
508 509 | def cls_method(cls) -> None: | ||
509 510 | pass | ||
|
||
E30.py:486:5: E301 [*] Expected 1 blank line, found 0 | ||
E30.py:519:5: E301 [*] Expected 1 blank line, found 0 | ||
| | ||
484 | def method(cls) -> None: | ||
485 | pass | ||
486 | @classmethod | ||
517 | def method(cls) -> None: | ||
518 | pass | ||
519 | @classmethod | ||
| ^ E301 | ||
487 | def cls_method(cls) -> None: | ||
488 | pass | ||
520 | def cls_method(cls) -> None: | ||
521 | pass | ||
| | ||
= help: Add missing blank line | ||
|
||
ℹ Safe fix | ||
483 483 | | ||
484 484 | def method(cls) -> None: | ||
485 485 | pass | ||
486 |+ | ||
486 487 | @classmethod | ||
487 488 | def cls_method(cls) -> None: | ||
488 489 | pass | ||
516 516 | | ||
517 517 | def method(cls) -> None: | ||
518 518 | pass | ||
519 |+ | ||
519 520 | @classmethod | ||
520 521 | def cls_method(cls) -> None: | ||
521 522 | pass | ||
|
||
E30.py:534:5: E301 [*] Expected 1 blank line, found 0 | ||
| | ||
532 | def bar(self, x: str) -> str: | ||
533 | ... | ||
534 | def bar(self, x: int | str) -> int | str: | ||
| ^^^ E301 | ||
535 | return x | ||
536 | # end | ||
| | ||
= help: Add missing blank line | ||
|
||
ℹ Safe fix | ||
531 531 | @overload | ||
532 532 | def bar(self, x: str) -> str: | ||
533 533 | ... | ||
534 |+ | ||
534 535 | def bar(self, x: int | str) -> int | str: | ||
535 536 | return x | ||
536 537 | # end |
Oops, something went wrong.