diff --git a/crates/ruff_linter/resources/test/fixtures/pycodestyle/E30.py b/crates/ruff_linter/resources/test/fixtures/pycodestyle/E30.py index d09f9e67a95b0..5446611850a39 100644 --- a/crates/ruff_linter/resources/test/fixtures/pycodestyle/E30.py +++ b/crates/ruff_linter/resources/test/fixtures/pycodestyle/E30.py @@ -356,6 +356,18 @@ def f(): # end +# no error +if ( + cond1 + + + + and cond2 +): + pass +# end + + # E301 class Class(object): diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E301_E30.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E301_E30.py.snap index 8924ed271d707..5189f0cb05b37 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E301_E30.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E301_E30.py.snap @@ -1,44 +1,44 @@ --- source: crates/ruff_linter/src/rules/pycodestyle/mod.rs --- -E30.py:364:5: E301 [*] Expected 1 blank line, found 0 +E30.py:376:5: E301 [*] Expected 1 blank line, found 0 | -362 | def func1(): -363 | pass -364 | def func2(): +374 | def func1(): +375 | pass +376 | def func2(): | ^^^ E301 -365 | pass -366 | # end +377 | pass +378 | # end | = help: Add missing blank line(s) ℹ Safe fix -361 361 | -362 362 | def func1(): -363 363 | pass - 364 |+ -364 365 | def func2(): -365 366 | pass -366 367 | # end +373 373 | +374 374 | def func1(): +375 375 | pass + 376 |+ +376 377 | def func2(): +377 378 | pass +378 379 | # end -E30.py:375:5: E301 [*] Expected 1 blank line, found 0 +E30.py:387:5: E301 [*] Expected 1 blank line, found 0 | -373 | pass -374 | # comment -375 | def fn2(): +385 | pass +386 | # comment +387 | def fn2(): | ^^^ E301 -376 | pass -377 | # end +388 | pass +389 | # end | = help: Add missing blank line(s) ℹ Safe fix -371 371 | -372 372 | def fn1(): -373 373 | pass - 374 |+ -374 375 | # comment -375 376 | def fn2(): -376 377 | pass +383 383 | +384 384 | def fn1(): +385 385 | pass + 386 |+ +386 387 | # comment +387 388 | def fn2(): +388 389 | pass diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E302_E30.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E302_E30.py.snap index d9b81fcf89e81..c81cece882661 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E302_E30.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E302_E30.py.snap @@ -1,186 +1,186 @@ --- source: crates/ruff_linter/src/rules/pycodestyle/mod.rs --- -E30.py:382:1: E302 [*] Expected 2 blank lines, found 0 +E30.py:394:1: E302 [*] Expected 2 blank lines, found 0 | -380 | # E302 -381 | """Main module.""" -382 | def fn(): +392 | # E302 +393 | """Main module.""" +394 | def fn(): | ^^^ E302 -383 | pass -384 | # end +395 | pass +396 | # end | = help: Add missing blank line(s) ℹ Safe fix -379 379 | -380 380 | # E302 -381 381 | """Main module.""" - 382 |+ - 383 |+ -382 384 | def fn(): -383 385 | pass -384 386 | # end - -E30.py:389:1: E302 [*] Expected 2 blank lines, found 0 - | -387 | # E302 -388 | import sys -389 | def get_sys_path(): +391 391 | +392 392 | # E302 +393 393 | """Main module.""" + 394 |+ + 395 |+ +394 396 | def fn(): +395 397 | pass +396 398 | # end + +E30.py:401:1: E302 [*] Expected 2 blank lines, found 0 + | +399 | # E302 +400 | import sys +401 | def get_sys_path(): | ^^^ E302 -390 | return sys.path -391 | # end +402 | return sys.path +403 | # end | = help: Add missing blank line(s) ℹ Safe fix -386 386 | -387 387 | # E302 -388 388 | import sys - 389 |+ - 390 |+ -389 391 | def get_sys_path(): -390 392 | return sys.path -391 393 | # end - -E30.py:398:1: E302 [*] Expected 2 blank lines, found 1 - | -396 | pass -397 | -398 | def b(): +398 398 | +399 399 | # E302 +400 400 | import sys + 401 |+ + 402 |+ +401 403 | def get_sys_path(): +402 404 | return sys.path +403 405 | # end + +E30.py:410:1: E302 [*] Expected 2 blank lines, found 1 + | +408 | pass +409 | +410 | def b(): | ^^^ E302 -399 | pass -400 | # end +411 | pass +412 | # end | = help: Add missing blank line(s) ℹ Safe fix -395 395 | def a(): -396 396 | pass -397 397 | - 398 |+ -398 399 | def b(): -399 400 | pass -400 401 | # end - -E30.py:409:1: E302 [*] Expected 2 blank lines, found 1 - | -407 | # comment -408 | -409 | def b(): +407 407 | def a(): +408 408 | pass +409 409 | + 410 |+ +410 411 | def b(): +411 412 | pass +412 413 | # end + +E30.py:421:1: E302 [*] Expected 2 blank lines, found 1 + | +419 | # comment +420 | +421 | def b(): | ^^^ E302 -410 | pass -411 | # end +422 | pass +423 | # end | = help: Add missing blank line(s) ℹ Safe fix -404 404 | def a(): -405 405 | pass -406 406 | - 407 |+ -407 408 | # comment -408 409 | -409 410 | def b(): - -E30.py:418:1: E302 [*] Expected 2 blank lines, found 1 - | -416 | pass -417 | -418 | async def b(): +416 416 | def a(): +417 417 | pass +418 418 | + 419 |+ +419 420 | # comment +420 421 | +421 422 | def b(): + +E30.py:430:1: E302 [*] Expected 2 blank lines, found 1 + | +428 | pass +429 | +430 | async def b(): | ^^^^^ E302 -419 | pass -420 | # end +431 | pass +432 | # end | = help: Add missing blank line(s) ℹ Safe fix -415 415 | def a(): -416 416 | pass -417 417 | - 418 |+ -418 419 | async def b(): -419 420 | pass -420 421 | # end - -E30.py:427:1: E302 [*] Expected 2 blank lines, found 1 - | -425 | pass -426 | -427 | async def x(y: int = 1): +427 427 | def a(): +428 428 | pass +429 429 | + 430 |+ +430 431 | async def b(): +431 432 | pass +432 433 | # end + +E30.py:439:1: E302 [*] Expected 2 blank lines, found 1 + | +437 | pass +438 | +439 | async def x(y: int = 1): | ^^^^^ E302 -428 | pass -429 | # end +440 | pass +441 | # end | = help: Add missing blank line(s) ℹ Safe fix -424 424 | async def x(): -425 425 | pass -426 426 | - 427 |+ -427 428 | async def x(y: int = 1): -428 429 | pass -429 430 | # end - -E30.py:435:1: E302 [*] Expected 2 blank lines, found 0 - | -433 | def bar(): -434 | pass -435 | def baz(): pass +436 436 | async def x(): +437 437 | pass +438 438 | + 439 |+ +439 440 | async def x(y: int = 1): +440 441 | pass +441 442 | # end + +E30.py:447:1: E302 [*] Expected 2 blank lines, found 0 + | +445 | def bar(): +446 | pass +447 | def baz(): pass | ^^^ E302 -436 | # end +448 | # end | = help: Add missing blank line(s) ℹ Safe fix -432 432 | # E302 -433 433 | def bar(): -434 434 | pass - 435 |+ - 436 |+ -435 437 | def baz(): pass -436 438 | # end -437 439 | - -E30.py:441:1: E302 [*] Expected 2 blank lines, found 0 - | -439 | # E302 -440 | def bar(): pass -441 | def baz(): +444 444 | # E302 +445 445 | def bar(): +446 446 | pass + 447 |+ + 448 |+ +447 449 | def baz(): pass +448 450 | # end +449 451 | + +E30.py:453:1: E302 [*] Expected 2 blank lines, found 0 + | +451 | # E302 +452 | def bar(): pass +453 | def baz(): | ^^^ E302 -442 | pass -443 | # end +454 | pass +455 | # end | = help: Add missing blank line(s) ℹ Safe fix -438 438 | -439 439 | # E302 -440 440 | def bar(): pass - 441 |+ - 442 |+ -441 443 | def baz(): -442 444 | pass -443 445 | # end - -E30.py:451:1: E302 [*] Expected 2 blank lines, found 1 - | -450 | # comment -451 | @decorator +450 450 | +451 451 | # E302 +452 452 | def bar(): pass + 453 |+ + 454 |+ +453 455 | def baz(): +454 456 | pass +455 457 | # end + +E30.py:463:1: E302 [*] Expected 2 blank lines, found 1 + | +462 | # comment +463 | @decorator | ^ E302 -452 | def g(): -453 | pass +464 | def g(): +465 | pass | = help: Add missing blank line(s) ℹ Safe fix -447 447 | def f(): -448 448 | pass -449 449 | - 450 |+ -450 451 | # comment -451 452 | @decorator -452 453 | def g(): +459 459 | def f(): +460 460 | pass +461 461 | + 462 |+ +462 463 | # comment +463 464 | @decorator +464 465 | def g(): diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E303_E30.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E303_E30.py.snap index d20f62dd570ea..ce0d30bc1576d 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E303_E30.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E303_E30.py.snap @@ -1,30 +1,12 @@ --- source: crates/ruff_linter/src/rules/pycodestyle/mod.rs --- -E30.py:462:5: E303 [*] Too many blank lines (2) - | -462 | # arbitrary comment - | ^^^^^^^^^^^^^^^^^^^ E303 -463 | -464 | def inner(): # E306 not expected - | - = help: Remove extraneous blank line(s) - -ℹ Safe fix -458 458 | def fn(): -459 459 | _ = None -460 460 | -461 |- -462 461 | # arbitrary comment -463 462 | -464 463 | def inner(): # E306 not expected - E30.py:474:5: E303 [*] Too many blank lines (2) | 474 | # arbitrary comment | ^^^^^^^^^^^^^^^^^^^ E303 -475 | def inner(): # E306 not expected -476 | pass +475 | +476 | def inner(): # E306 not expected | = help: Remove extraneous blank line(s) @@ -34,130 +16,148 @@ E30.py:474:5: E303 [*] Too many blank lines (2) 472 472 | 473 |- 474 473 | # arbitrary comment -475 474 | def inner(): # E306 not expected -476 475 | pass +475 474 | +476 475 | def inner(): # E306 not expected + +E30.py:486:5: E303 [*] Too many blank lines (2) + | +486 | # arbitrary comment + | ^^^^^^^^^^^^^^^^^^^ E303 +487 | def inner(): # E306 not expected +488 | pass + | + = help: Remove extraneous blank line(s) + +ℹ Safe fix +482 482 | def fn(): +483 483 | _ = None +484 484 | +485 |- +486 485 | # arbitrary comment +487 486 | def inner(): # E306 not expected +488 487 | pass -E30.py:485:1: E303 [*] Too many blank lines (3) +E30.py:497:1: E303 [*] Too many blank lines (3) | -485 | print() +497 | print() | ^^^^^ E303 -486 | # end +498 | # end | = help: Remove extraneous blank line(s) ℹ Safe fix -481 481 | print() -482 482 | -483 483 | -484 |- -485 484 | print() -486 485 | # end -487 486 | +493 493 | print() +494 494 | +495 495 | +496 |- +497 496 | print() +498 497 | # end +499 498 | -E30.py:494:1: E303 [*] Too many blank lines (3) +E30.py:506:1: E303 [*] Too many blank lines (3) | -494 | # comment +506 | # comment | ^^^^^^^^^ E303 -495 | -496 | print() +507 | +508 | print() | = help: Remove extraneous blank line(s) ℹ Safe fix -490 490 | print() -491 491 | -492 492 | -493 |- -494 493 | # comment -495 494 | -496 495 | print() +502 502 | print() +503 503 | +504 504 | +505 |- +506 505 | # comment +507 506 | +508 507 | print() -E30.py:505:5: E303 [*] Too many blank lines (2) +E30.py:517:5: E303 [*] Too many blank lines (2) | -505 | # comment +517 | # comment | ^^^^^^^^^ E303 | = help: Remove extraneous blank line(s) ℹ Safe fix -501 501 | def a(): -502 502 | print() -503 503 | -504 |- -505 504 | # comment -506 505 | -507 506 | +513 513 | def a(): +514 514 | print() +515 515 | +516 |- +517 516 | # comment +518 517 | +519 518 | -E30.py:508:5: E303 [*] Too many blank lines (2) +E30.py:520:5: E303 [*] Too many blank lines (2) | -508 | # another comment +520 | # another comment | ^^^^^^^^^^^^^^^^^ E303 -509 | -510 | print() +521 | +522 | print() | = help: Remove extraneous blank line(s) ℹ Safe fix -504 504 | -505 505 | # comment -506 506 | -507 |- -508 507 | # another comment -509 508 | -510 509 | print() - -E30.py:519:1: E303 [*] Too many blank lines (3) - | -519 | / """This class docstring comes on line 5. -520 | | It gives error E303: too many blank lines (3) -521 | | """ +516 516 | +517 517 | # comment +518 518 | +519 |- +520 519 | # another comment +521 520 | +522 521 | print() + +E30.py:531:1: E303 [*] Too many blank lines (3) + | +531 | / """This class docstring comes on line 5. +532 | | It gives error E303: too many blank lines (3) +533 | | """ | |___^ E303 -522 | # end +534 | # end | = help: Remove extraneous blank line(s) ℹ Safe fix -515 515 | #!python -516 516 | -517 517 | -518 |- -519 518 | """This class docstring comes on line 5. -520 519 | It gives error E303: too many blank lines (3) -521 520 | """ +527 527 | #!python +528 528 | +529 529 | +530 |- +531 530 | """This class docstring comes on line 5. +532 531 | It gives error E303: too many blank lines (3) +533 532 | """ -E30.py:531:5: E303 [*] Too many blank lines (2) +E30.py:543:5: E303 [*] Too many blank lines (2) | -531 | def b(self): +543 | def b(self): | ^^^ E303 -532 | pass -533 | # end +544 | pass +545 | # end | = help: Remove extraneous blank line(s) ℹ Safe fix -527 527 | def a(self): -528 528 | pass -529 529 | -530 |- -531 530 | def b(self): -532 531 | pass -533 532 | # end +539 539 | def a(self): +540 540 | pass +541 541 | +542 |- +543 542 | def b(self): +544 543 | pass +545 544 | # end -E30.py:541:5: E303 [*] Too many blank lines (2) +E30.py:553:5: E303 [*] Too many blank lines (2) | -541 | a = 2 +553 | a = 2 | ^ E303 -542 | # end +554 | # end | = help: Remove extraneous blank line(s) ℹ Safe fix -537 537 | if True: -538 538 | a = 1 -539 539 | -540 |- -541 540 | a = 2 -542 541 | # end -543 542 | +549 549 | if True: +550 550 | a = 1 +551 551 | +552 |- +553 552 | a = 2 +554 553 | # end +555 554 | diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E304_E30.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E304_E30.py.snap index 77a17561b882d..407ab1b4d5d6b 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E304_E30.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E304_E30.py.snap @@ -1,24 +1,24 @@ --- source: crates/ruff_linter/src/rules/pycodestyle/mod.rs --- -E30.py:548:1: E304 [*] blank lines found after function decorator +E30.py:560:1: E304 [*] blank lines found after function decorator | -546 | @decorator -547 | -548 | def function(): +558 | @decorator +559 | +560 | def function(): | ^^^ E304 -549 | pass -550 | # end +561 | pass +562 | # end | = help: Remove extraneous blank line(s) ℹ Safe fix -544 544 | -545 545 | # E304 -546 546 | @decorator -547 |- -548 547 | def function(): -549 548 | pass -550 549 | # end +556 556 | +557 557 | # E304 +558 558 | @decorator +559 |- +560 559 | def function(): +561 560 | pass +562 561 | # end diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E305_E30.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E305_E30.py.snap index 6fc6b93e89781..c7e9b2f255b10 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E305_E30.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E305_E30.py.snap @@ -1,102 +1,102 @@ --- source: crates/ruff_linter/src/rules/pycodestyle/mod.rs --- -E30.py:560:1: E305 [*] expected 2 blank lines after class or function definition, found (0) +E30.py:572:1: E305 [*] expected 2 blank lines after class or function definition, found (0) | -559 | # another comment -560 | fn() +571 | # another comment +572 | fn() | ^^ E305 -561 | # end +573 | # end | = help: Add missing blank line(s) ℹ Safe fix -557 557 | # comment -558 558 | -559 559 | # another comment - 560 |+ - 561 |+ -560 562 | fn() -561 563 | # end -562 564 | +569 569 | # comment +570 570 | +571 571 | # another comment + 572 |+ + 573 |+ +572 574 | fn() +573 575 | # end +574 576 | -E30.py:571:1: E305 [*] expected 2 blank lines after class or function definition, found (0) +E30.py:583:1: E305 [*] expected 2 blank lines after class or function definition, found (0) | -570 | # another comment -571 | a = 1 +582 | # another comment +583 | a = 1 | ^ E305 -572 | # end +584 | # end | = help: Add missing blank line(s) ℹ Safe fix -568 568 | # comment -569 569 | -570 570 | # another comment - 571 |+ - 572 |+ -571 573 | a = 1 -572 574 | # end -573 575 | +580 580 | # comment +581 581 | +582 582 | # another comment + 583 |+ + 584 |+ +583 585 | a = 1 +584 586 | # end +585 587 | -E30.py:583:1: E305 [*] expected 2 blank lines after class or function definition, found (1) +E30.py:595:1: E305 [*] expected 2 blank lines after class or function definition, found (1) | -581 | # another comment -582 | -583 | try: +593 | # another comment +594 | +595 | try: | ^^^ E305 -584 | fn() -585 | except Exception: +596 | fn() +597 | except Exception: | = help: Add missing blank line(s) ℹ Safe fix -580 580 | -581 581 | # another comment -582 582 | - 583 |+ -583 584 | try: -584 585 | fn() -585 586 | except Exception: +592 592 | +593 593 | # another comment +594 594 | + 595 |+ +595 596 | try: +596 597 | fn() +597 598 | except Exception: -E30.py:595:1: E305 [*] expected 2 blank lines after class or function definition, found (0) +E30.py:607:1: E305 [*] expected 2 blank lines after class or function definition, found (0) | -594 | # Two spaces before comments, too. -595 | if a(): +606 | # Two spaces before comments, too. +607 | if a(): | ^^ E305 -596 | a() -597 | # end +608 | a() +609 | # end | = help: Add missing blank line(s) ℹ Safe fix -592 592 | print -593 593 | -594 594 | # Two spaces before comments, too. - 595 |+ - 596 |+ -595 597 | if a(): -596 598 | a() -597 599 | # end +604 604 | print +605 605 | +606 606 | # Two spaces before comments, too. + 607 |+ + 608 |+ +607 609 | if a(): +608 610 | a() +609 611 | # end -E30.py:608:1: E305 [*] expected 2 blank lines after class or function definition, found (1) +E30.py:620:1: E305 [*] expected 2 blank lines after class or function definition, found (1) | -606 | blah, blah -607 | -608 | if __name__ == '__main__': +618 | blah, blah +619 | +620 | if __name__ == '__main__': | ^^ E305 -609 | main() -610 | # end +621 | main() +622 | # end | = help: Add missing blank line(s) ℹ Safe fix -605 605 | def main(): -606 606 | blah, blah -607 607 | - 608 |+ -608 609 | if __name__ == '__main__': -609 610 | main() -610 611 | # end +617 617 | def main(): +618 618 | blah, blah +619 619 | + 620 |+ +620 621 | if __name__ == '__main__': +621 622 | main() +622 623 | # end diff --git a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E306_E30.py.snap b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E306_E30.py.snap index 3b69bf5ca4be6..016d37ee1f02a 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E306_E30.py.snap +++ b/crates/ruff_linter/src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E306_E30.py.snap @@ -1,223 +1,223 @@ --- source: crates/ruff_linter/src/rules/pycodestyle/mod.rs --- -E30.py:616:5: E306 [*] Expected 1 blank line before a nested definition, found 0 +E30.py:628:5: E306 [*] Expected 1 blank line before a nested definition, found 0 | -614 | def a(): -615 | x = 1 -616 | def b(): +626 | def a(): +627 | x = 1 +628 | def b(): | ^^^ E306 -617 | pass -618 | # end +629 | pass +630 | # end | = help: Add missing blank line ℹ Safe fix -613 613 | # E306:3:5 -614 614 | def a(): -615 615 | x = 1 - 616 |+ -616 617 | def b(): -617 618 | pass -618 619 | # end - -E30.py:624:5: E306 [*] Expected 1 blank line before a nested definition, found 0 - | -622 | async def a(): -623 | x = 1 -624 | def b(): +625 625 | # E306:3:5 +626 626 | def a(): +627 627 | x = 1 + 628 |+ +628 629 | def b(): +629 630 | pass +630 631 | # end + +E30.py:636:5: E306 [*] Expected 1 blank line before a nested definition, found 0 + | +634 | async def a(): +635 | x = 1 +636 | def b(): | ^^^ E306 -625 | pass -626 | # end +637 | pass +638 | # end | = help: Add missing blank line ℹ Safe fix -621 621 | #: E306:3:5 -622 622 | async def a(): -623 623 | x = 1 - 624 |+ -624 625 | def b(): -625 626 | pass -626 627 | # end - -E30.py:632:5: E306 [*] Expected 1 blank line before a nested definition, found 0 - | -630 | def a(): -631 | x = 2 -632 | def b(): +633 633 | #: E306:3:5 +634 634 | async def a(): +635 635 | x = 1 + 636 |+ +636 637 | def b(): +637 638 | pass +638 639 | # end + +E30.py:644:5: E306 [*] Expected 1 blank line before a nested definition, found 0 + | +642 | def a(): +643 | x = 2 +644 | def b(): | ^^^ E306 -633 | x = 1 -634 | def c(): +645 | x = 1 +646 | def c(): | = help: Add missing blank line ℹ Safe fix -629 629 | #: E306:3:5 E306:5:9 -630 630 | def a(): -631 631 | x = 2 - 632 |+ -632 633 | def b(): -633 634 | x = 1 -634 635 | def c(): - -E30.py:634:9: E306 [*] Expected 1 blank line before a nested definition, found 0 - | -632 | def b(): -633 | x = 1 -634 | def c(): +641 641 | #: E306:3:5 E306:5:9 +642 642 | def a(): +643 643 | x = 2 + 644 |+ +644 645 | def b(): +645 646 | x = 1 +646 647 | def c(): + +E30.py:646:9: E306 [*] Expected 1 blank line before a nested definition, found 0 + | +644 | def b(): +645 | x = 1 +646 | def c(): | ^^^ E306 -635 | pass -636 | # end +647 | pass +648 | # end | = help: Add missing blank line ℹ Safe fix -631 631 | x = 2 -632 632 | def b(): -633 633 | x = 1 - 634 |+ -634 635 | def c(): -635 636 | pass -636 637 | # end - -E30.py:642:5: E306 [*] Expected 1 blank line before a nested definition, found 0 - | -640 | def a(): -641 | x = 1 -642 | class C: +643 643 | x = 2 +644 644 | def b(): +645 645 | x = 1 + 646 |+ +646 647 | def c(): +647 648 | pass +648 649 | # end + +E30.py:654:5: E306 [*] Expected 1 blank line before a nested definition, found 0 + | +652 | def a(): +653 | x = 1 +654 | class C: | ^^^^^ E306 -643 | pass -644 | x = 2 +655 | pass +656 | x = 2 | = help: Add missing blank line ℹ Safe fix -639 639 | # E306:3:5 E306:6:5 -640 640 | def a(): -641 641 | x = 1 - 642 |+ -642 643 | class C: -643 644 | pass -644 645 | x = 2 - -E30.py:645:5: E306 [*] Expected 1 blank line before a nested definition, found 0 - | -643 | pass -644 | x = 2 -645 | def b(): +651 651 | # E306:3:5 E306:6:5 +652 652 | def a(): +653 653 | x = 1 + 654 |+ +654 655 | class C: +655 656 | pass +656 657 | x = 2 + +E30.py:657:5: E306 [*] Expected 1 blank line before a nested definition, found 0 + | +655 | pass +656 | x = 2 +657 | def b(): | ^^^ E306 -646 | pass -647 | # end +658 | pass +659 | # end | = help: Add missing blank line ℹ Safe fix -642 642 | class C: -643 643 | pass -644 644 | x = 2 - 645 |+ -645 646 | def b(): -646 647 | pass -647 648 | # end - -E30.py:654:5: E306 [*] Expected 1 blank line before a nested definition, found 0 - | -652 | def bar(): -653 | pass -654 | def baz(): pass +654 654 | class C: +655 655 | pass +656 656 | x = 2 + 657 |+ +657 658 | def b(): +658 659 | pass +659 660 | # end + +E30.py:666:5: E306 [*] Expected 1 blank line before a nested definition, found 0 + | +664 | def bar(): +665 | pass +666 | def baz(): pass | ^^^ E306 -655 | # end +667 | # end | = help: Add missing blank line ℹ Safe fix -651 651 | def foo(): -652 652 | def bar(): -653 653 | pass - 654 |+ -654 655 | def baz(): pass -655 656 | # end -656 657 | - -E30.py:661:5: E306 [*] Expected 1 blank line before a nested definition, found 0 - | -659 | def foo(): -660 | def bar(): pass -661 | def baz(): +663 663 | def foo(): +664 664 | def bar(): +665 665 | pass + 666 |+ +666 667 | def baz(): pass +667 668 | # end +668 669 | + +E30.py:673:5: E306 [*] Expected 1 blank line before a nested definition, found 0 + | +671 | def foo(): +672 | def bar(): pass +673 | def baz(): | ^^^ E306 -662 | pass -663 | # end +674 | pass +675 | # end | = help: Add missing blank line ℹ Safe fix -658 658 | # E306:3:5 -659 659 | def foo(): -660 660 | def bar(): pass - 661 |+ -661 662 | def baz(): -662 663 | pass -663 664 | # end - -E30.py:669:5: E306 [*] Expected 1 blank line before a nested definition, found 0 - | -667 | def a(): -668 | x = 2 -669 | @decorator +670 670 | # E306:3:5 +671 671 | def foo(): +672 672 | def bar(): pass + 673 |+ +673 674 | def baz(): +674 675 | pass +675 676 | # end + +E30.py:681:5: E306 [*] Expected 1 blank line before a nested definition, found 0 + | +679 | def a(): +680 | x = 2 +681 | @decorator | ^ E306 -670 | def b(): -671 | pass +682 | def b(): +683 | pass | = help: Add missing blank line ℹ Safe fix -666 666 | # E306 -667 667 | def a(): -668 668 | x = 2 - 669 |+ -669 670 | @decorator -670 671 | def b(): -671 672 | pass - -E30.py:678:5: E306 [*] Expected 1 blank line before a nested definition, found 0 - | -676 | def a(): -677 | x = 2 -678 | @decorator +678 678 | # E306 +679 679 | def a(): +680 680 | x = 2 + 681 |+ +681 682 | @decorator +682 683 | def b(): +683 684 | pass + +E30.py:690:5: E306 [*] Expected 1 blank line before a nested definition, found 0 + | +688 | def a(): +689 | x = 2 +690 | @decorator | ^ E306 -679 | async def b(): -680 | pass +691 | async def b(): +692 | pass | = help: Add missing blank line ℹ Safe fix -675 675 | # E306 -676 676 | def a(): -677 677 | x = 2 - 678 |+ -678 679 | @decorator -679 680 | async def b(): -680 681 | pass - -E30.py:687:5: E306 [*] Expected 1 blank line before a nested definition, found 0 - | -685 | def a(): -686 | x = 2 -687 | async def b(): +687 687 | # E306 +688 688 | def a(): +689 689 | x = 2 + 690 |+ +690 691 | @decorator +691 692 | async def b(): +692 693 | pass + +E30.py:699:5: E306 [*] Expected 1 blank line before a nested definition, found 0 + | +697 | def a(): +698 | x = 2 +699 | async def b(): | ^^^^^ E306 -688 | pass -689 | # end +700 | pass +701 | # end | = help: Add missing blank line ℹ Safe fix -684 684 | # E306 -685 685 | def a(): -686 686 | x = 2 - 687 |+ -687 688 | async def b(): -688 689 | pass -689 690 | # end +696 696 | # E306 +697 697 | def a(): +698 698 | x = 2 + 699 |+ +699 700 | async def b(): +700 701 | pass +701 702 | # end