Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module docstrings aren't formatted, unlike other docstrings #3493

Open
yilei opened this issue Jan 11, 2023 · 0 comments
Open

Module docstrings aren't formatted, unlike other docstrings #3493

yilei opened this issue Jan 11, 2023 · 0 comments
Labels
F: docstrings How we format docstrings T: style What do we want Blackened code to look like?

Comments

@yilei
Copy link
Contributor

yilei commented Jan 11, 2023

Example: https://black.vercel.app/?version=main&state=_Td6WFoAAATm1rRGAgAhARYAAAB0L-Wj4ADgAHldAD2IimZxl1N_Wk8FsJZhkAjhyjG3tVjxJ9Gp9Zojsi1i8DVq3VtVGWVA4en-neQWZRs0Yby6Rh486UwtT5kSyua0nvj17KQw7tG7Ya2GvmqWyx6rvshnP2g3A9E7w_INJJXQ8vt9s7PWaZ1j-sQaPDU8Y6Oj32p-9QAAAAAAuYXePL9oFb0AAZUB4QEAAPc2n9yxxGf7AgAAAAAEWVo=

"""This is a module docstring.


"""


def func():
    """This is a func docstring.
    
    
    """

is formatted to:

"""This is a module docstring.


"""


def func():
    """This is a func docstring."""

From what I can tell, this is because is_docstring(leaf) returns False for the module doc here, so this looks like a bug, not an intentional design choice?

@yilei yilei added the T: style What do we want Blackened code to look like? label Jan 11, 2023
@ichard26 ichard26 added the F: docstrings How we format docstrings label Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F: docstrings How we format docstrings T: style What do we want Blackened code to look like?
Projects
None yet
Development

No branches or pull requests

2 participants