black icon indicating copy to clipboard operation
black copied to clipboard

# fmt: skip failed to skip one-line format

Open WaveBird opened this issue 2 years ago • 0 comments

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.

WaveBird avatar Mar 13 '23 10:03 WaveBird