---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
E302 [*] Expected 2 blank lines, found 0
   --> E30.py:533:1
    |
531 | # E302
532 | """Main module."""
533 | def fn():
    | ^^^
534 |     pass
535 | # end
    |
help: Add missing blank line(s)
    |
532 | """Main module."""
533 +
534 +
535 | def fn():
    |

E302 [*] Expected 2 blank lines, found 0
   --> E30.py:540:1
    |
538 | # E302
539 | import sys
540 | def get_sys_path():
    | ^^^
541 |     return sys.path
542 | # end
    |
help: Add missing blank line(s)
    |
539 | import sys
540 +
541 +
542 | def get_sys_path():
    |

E302 [*] Expected 2 blank lines, found 1
   --> E30.py:549:1
    |
547 |     pass
548 |
549 | def b():
    | ^^^
550 |     pass
551 | # end
    |
help: Add missing blank line(s)
    |
548 |
549 +
550 | def b():
    |

E302 [*] Expected 2 blank lines, found 1
   --> E30.py:560:1
    |
558 | # comment
559 |
560 | def b():
    | ^^^
561 |     pass
562 | # end
    |
help: Add missing blank line(s)
    |
559 |
560 +
561 | def b():
    |

E302 [*] Expected 2 blank lines, found 1
   --> E30.py:569:1
    |
567 |     pass
568 |
569 | async def b():
    | ^^^^^
570 |     pass
571 | # end
    |
help: Add missing blank line(s)
    |
568 |
569 +
570 | async def b():
    |

E302 [*] Expected 2 blank lines, found 1
   --> E30.py:578:1
    |
576 |     pass
577 |
578 | async  def x(y: int = 1):
    | ^^^^^
579 |     pass
580 | # end
    |
help: Add missing blank line(s)
    |
577 |
578 +
579 | async  def x(y: int = 1):
    |

E302 [*] Expected 2 blank lines, found 0
   --> E30.py:586:1
    |
584 | def bar():
585 |     pass
586 | def baz(): pass
    | ^^^
587 | # end
    |
help: Add missing blank line(s)
    |
585 |     pass
586 +
587 +
588 | def baz(): pass
    |

E302 [*] Expected 2 blank lines, found 0
   --> E30.py:592:1
    |
590 | # E302
591 | def bar(): pass
592 | def baz():
    | ^^^
593 |     pass
594 | # end
    |
help: Add missing blank line(s)
    |
591 | def bar(): pass
592 +
593 +
594 | def baz():
    |

E302 [*] Expected 2 blank lines, found 1
   --> E30.py:602:1
    |
601 | # comment
602 | @decorator
    | ^
603 | def g():
604 |     pass
    |
help: Add missing blank line(s)
    |
600 |
601 +
602 | # comment
    |

E302 [*] Expected 2 blank lines, found 0
   --> E30.py:624:1
    |
622 | # E302
623 | class A:...
624 | class B: ...
    | ^^^^^
625 | # end
    |
help: Add missing blank line(s)
    |
623 | class A:...
624 +
625 +
626 | class B: ...
    |

E302 [*] Expected 2 blank lines, found 1
   --> E30.py:634:1
    |
632 | def fn(a: str) -> str: ...
633 |
634 | def fn(a: int | str) -> int | str:
    | ^^^
635 |     ...
636 | # end
    |
help: Add missing blank line(s)
    |
633 |
634 +
635 | def fn(a: int | str) -> int | str:
    |

E302 [*] Expected 2 blank lines, found 0
   --> E30.py:944:1
    |
942 |     pass
943 |     # comment
944 | def test_clientmodel():
    | ^^^
945 |     pass
946 | # end
    |
help: Add missing blank line(s)
    |
943 |     # comment
944 +
945 +
946 | def test_clientmodel():
    |

E302 [*] Expected 2 blank lines, found 0
   --> E30.py:953:1
    |
951 |     pass
952 |         # comment
953 | def test_clientmodel():
    | ^^^
954 |     pass
955 | # end
    |
help: Add missing blank line(s)
    |
952 |         # comment
953 +
954 +
955 | def test_clientmodel():
    |

E302 [*] Expected 2 blank lines, found 0
   --> E30.py:962:1
    |
960 |     pass
961 | # comment
962 | def test_clientmodel():
    | ^^^
963 |     pass
964 | # end
    |
help: Add missing blank line(s)
    |
960 |     pass
961 +
962 +
963 | # comment
    |
