---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
E306 [*] Expected 1 blank line before a nested definition, found 0
   --> E30.py:854:5
    |
852 | def a():
853 |     x = 1
854 |     def b():
    |     ^^^
855 |         pass
856 | # end
    |
help: Add missing blank line
    |
853 |     x = 1
854 +
855 |     def b():
    |

E306 [*] Expected 1 blank line before a nested definition, found 0
   --> E30.py:862:5
    |
860 | async def a():
861 |     x = 1
862 |     def b():
    |     ^^^
863 |         pass
864 | # end
    |
help: Add missing blank line
    |
861 |     x = 1
862 +
863 |     def b():
    |

E306 [*] Expected 1 blank line before a nested definition, found 0
   --> E30.py:870:5
    |
868 | def a():
869 |     x = 2
870 |     def b():
    |     ^^^
871 |         x = 1
872 |         def c():
    |
help: Add missing blank line
    |
869 |     x = 2
870 +
871 |     def b():
    |

E306 [*] Expected 1 blank line before a nested definition, found 0
   --> E30.py:872:9
    |
870 |     def b():
871 |         x = 1
872 |         def c():
    |         ^^^
873 |             pass
874 | # end
    |
help: Add missing blank line
    |
871 |         x = 1
872 +
873 |         def c():
    |

E306 [*] Expected 1 blank line before a nested definition, found 0
   --> E30.py:880:5
    |
878 | def a():
879 |     x = 1
880 |     class C:
    |     ^^^^^
881 |         pass
882 |     x = 2
    |
help: Add missing blank line
    |
879 |     x = 1
880 +
881 |     class C:
    |

E306 [*] Expected 1 blank line before a nested definition, found 0
   --> E30.py:883:5
    |
881 |         pass
882 |     x = 2
883 |     def b():
    |     ^^^
884 |         pass
885 | # end
    |
help: Add missing blank line
    |
882 |     x = 2
883 +
884 |     def b():
    |

E306 [*] Expected 1 blank line before a nested definition, found 0
   --> E30.py:892:5
    |
890 |     def bar():
891 |         pass
892 |     def baz(): pass
    |     ^^^
893 | # end
    |
help: Add missing blank line
    |
891 |         pass
892 +
893 |     def baz(): pass
    |

E306 [*] Expected 1 blank line before a nested definition, found 0
   --> E30.py:899:5
    |
897 | def foo():
898 |     def bar(): pass
899 |     def baz():
    |     ^^^
900 |         pass
901 | # end
    |
help: Add missing blank line
    |
898 |     def bar(): pass
899 +
900 |     def baz():
    |

E306 [*] Expected 1 blank line before a nested definition, found 0
   --> E30.py:907:5
    |
905 | def a():
906 |     x = 2
907 |     @decorator
    |     ^
908 |     def b():
909 |         pass
    |
help: Add missing blank line
    |
906 |     x = 2
907 +
908 |     @decorator
    |

E306 [*] Expected 1 blank line before a nested definition, found 0
   --> E30.py:916:5
    |
914 | def a():
915 |     x = 2
916 |     @decorator
    |     ^
917 |     async def b():
918 |         pass
    |
help: Add missing blank line
    |
915 |     x = 2
916 +
917 |     @decorator
    |

E306 [*] Expected 1 blank line before a nested definition, found 0
   --> E30.py:925:5
    |
923 | def a():
924 |     x = 2
925 |     async def b():
    |     ^^^^^
926 |         pass
927 | # end
    |
help: Add missing blank line
    |
924 |     x = 2
925 +
926 |     async def b():
    |

E306 [*] Expected 1 blank line before a nested definition, found 0
   --> E30.py:983:9
    |
981 |     async def recv(self, *, length=65536):
982 |         loop = asyncio.get_event_loop()
983 |         def callback():
    |         ^^^
984 |             loop.remove_reader(self._fd)
985 |         loop.add_reader(self._fd, callback)
    |
help: Add missing blank line
    |
982 |         loop = asyncio.get_event_loop()
983 +
984 |         def callback():
    |

E306 [*] Expected 1 blank line before a nested definition, found 0
    --> E30.py:1002:9
     |
1000 |     def f():
1001 |         x = 1
1002 |         def g():
     |         ^^^
1003 |             return 1
1004 |         return 2
     |
help: Add missing blank line
     |
1001 |         x = 1
1002 +
1003 |         def g():
     |

E306 [*] Expected 1 blank line before a nested definition, found 0
    --> E30.py:1009:13
     |
1007 |         class Baz:
1008 |             x = 1
1009 |             def g():
     |             ^^^
1010 |                 return 1
1011 |             return 2
     |
help: Add missing blank line
     |
1008 |             x = 1
1009 +
1010 |             def g():
     |
