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

Don't wrap | None on a new line #3874

Closed
Olegt0rr opened this issue Sep 10, 2023 · 1 comment
Closed

Don't wrap | None on a new line #3874

Olegt0rr opened this issue Sep 10, 2023 · 1 comment
Labels
T: style What do we want Blackened code to look like?

Comments

@Olegt0rr
Copy link

Olegt0rr commented Sep 10, 2023

Describe the style change

I don't like current behavior on documented FastAPI handlers.

@router.get("/path")
async def some_handler(
    can_restrict_members: bool | None = Query(None, description="Can restrict members?"),  # the line is toooooo long
):
    ...

Examples in the current Black style

async def some_handler(
    can_restrict_members: bool
    | None = Query(
        None,
        description="Can restrict members?",
    ),
):
    ...

Desired style

async def some_handler(
    can_restrict_members: bool | None = Query(
        None,
        description="Can restrict members?",
    ),
):
    ...

Additional context

black==23.9.0
@Olegt0rr Olegt0rr added the T: style What do we want Blackened code to look like? label Sep 10, 2023
@JelleZijlstra
Copy link
Collaborator

Thanks, duplicate of #2316. (I agree this style is ugly and we should change it. PRs welcome!)

@JelleZijlstra JelleZijlstra closed this as not planned Won't fix, can't repro, duplicate, stale Sep 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: style What do we want Blackened code to look like?
Projects
None yet
Development

No branches or pull requests

2 participants