8000 Module docstrings aren't formatted, unlike other docstrings · Issue #3493 · psf/black · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

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 r 8000 elated emails.

Already on GitHub? Sign in to your account

Closed
yilei opened this issue Jan 11, 2023 · 4 comments
Closed

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

yilei opened this issue Jan 11, 2023 · 4 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
@MichaReiser
Copy link

I think this is fixed now playground

@hauntsaninja
Copy link
Collaborator

Yeah, I think maybe even in the 2024 style

@tusharsadhwani
Copy link
Collaborator

@MichaReiser I'm not sure it is? The docstring is still being truncated on the playground link. Black shouldn't be modifying strings afaik.

@tusharsadhwani
Copy link
Collaborator

Oh, okay. My bad. It's been fixed, thanks for notifying.

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
3850
Development

No branches or pull requests

5 participants
0