Skip to content

6.2.0 reformats Spock data tables and multi-line map definitions #1681

Description

@jochenberger

After updating to 6.2.0, I noticed that a lot of my code was formatted much better (probably thanks to #1675).
However, there is a degradation wrt. data tables and map initializers:

6.1.0:

class TestSpec extends Specification{

    def "formatting is left intact"() {
        given:
        def m = [
            key     : 1,
            otherKey: 2
        ]

        expect:
        m[key] == value

        where:
        key | value
        a   | 1
        b   | 2
    }
}

6.2.0:

class TestSpec extends Specification{

    def "formatting is left intact"() {
        given:
        def m = [
            key : 1, // <--
            otherKey: 2
        ]

        expect:
        m[key] == value

        where:
        key | value
        a | 1 // <--
        b | 2 // <--
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions