mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-26 20:09:22 +00:00
![]() **Summary** Previously, own line comment following after a docstring followed by newline(s) before the first content statement were treated as trailing on the docstring and we didn't insert a newline after the docstring as black would. Before: ```python class ModuleBrowser: """Browse module classes and functions in IDLE.""" # This class is also the base class for pathbrowser.PathBrowser. def __init__(self, master, path, *, _htest=False, _utest=False): pass ``` After: ```python class ModuleBrowser: """Browse module classes and functions in IDLE.""" # This class is also the base class for pathbrowser.PathBrowser. def __init__(self, master, path, *, _htest=False, _utest=False): pass ``` I'm not entirely happy about hijacking `handle_own_line_comment_between_statements`, but i don't know a better spot to put it. Fixes #7948 **Test Plan** Fixtures |
||
---|---|---|
.. | ||
comments | ||
expression | ||
module | ||
other | ||
pattern | ||
snapshots | ||
statement | ||
type_param | ||
builders.rs | ||
cli.rs | ||
context.rs | ||
generated.rs | ||
lib.rs | ||
main.rs | ||
options.rs | ||
prelude.rs | ||
verbatim.rs |