Skip to content

Formatter undocumented deviation: comment line wrapping inside lists #7448

@m-richards

Description

@m-richards

Hi, thanks for building ruff, it's a great tool, and I've been watching eargerly for auto-formatter support for a while now. Have just tried it out and wanted to report a few formatting deviations - at least as far as I can tell from reading the readme. Apologies if any of these are duplicates, I've had a quick scan of the open issues and I can't seem to see these exact cases.

# before / with black
def test_to_wkb(self):
    wkbs0 = [
        (
            b"\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00"
            b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        ),  # POINT (0 0)
    ]
# after running `ruff format`
def test_to_wkb(self):
    wkbs0 = [
        (
            b"\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00"
            b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"  # POINT (0 0)
        ),
    ]

I don't know if this is related to the pragma comment rules? The difference is super minor but black's behaviour is preferable as it is the entire binary sequence inside the parentheses that is the binary encoding of a Point.

Metadata

Metadata

Assignees

Labels

acceptedReady for implementationbugSomething isn't workingformatterRelated to the formatter

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions