Skip to content

# fmt: skip failed to skip one-line format  #3603

@WaveBird

Description

@WaveBird

My environment is: python = 3.11.1, black = 23.1.0
the following is the info of commandpoetry show black:

 name         : black                              
 version      : 23.1.0                             
 description  : The uncompromising code formatter. 

dependencies
 - click >=8.0.0
 - mypy-extensions >=0.4.3
 - packaging >=22.0
 - pathspec >=0.9.0
 - platformdirs >=2

The code that black failed to skip:

join(
    packages,
    func.coalesce(orders.c.package_id, order_customer_types.c.package_id) == packages.c.id,  # fmt: skip
    isouter=True,
)

When I run black, I get this:

join(
    packages,
    func.coalesce(orders.c.package_id, order_customer_types.c.package_id)
    == packages.c.id,  # fmt: skip
    isouter=True,
)

But what I expect is black can skip formating the third line and keep it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions