keewis / blackdoc

run black on documentation code snippets
https://blackdoc.readthedocs.io
MIT License
47 stars 4 forks source link

don't drop / split leading comments and decorators #158

Closed keewis closed 2 years ago

keewis commented 2 years ago

In #155, support for splitting doctest lines that actually are two separate statements / expressions chained together by semicolons was added. However, decorators are not contained in lines[lineno:end_lineno], and comments are not even contained in the AST. This makes sure both work fine.