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

Formatting spock test damages the file #1219

Closed
monrealis opened this issue Jan 14, 2021 · 2 comments
Closed

Formatting spock test damages the file #1219

monrealis opened this issue Jan 14, 2021 · 2 comments
Assignees
Labels
Milestone

Comments

@monrealis
Copy link

Reformatting this file

import spock.lang.Specification

class MySpec extends Specification {
    def "test"() {
        expect:
        [] == [] 
        toString()
    }
}

results in this

import spock.lang.Specification

class MySpec extends Specification {
    def "test"() {
        expect:
        []== []toString()
    }
}

Notice the space at the end of line 6
image

Groovy Plugin Version: Eclipse Groovy Development Tools 4.0.0.v202012170419-e2012
Eclipse version: Version: 2020-12 (4.18.0) Build id: 20201210-1552

@eric-milles eric-milles self-assigned this Jan 31, 2021
@eric-milles eric-milles added this to the v4.1.0 milestone Jan 31, 2021
@eric-milles
Copy link
Member

There is code in the formatter to compact list literals, including trailing whitespace. This is what is affecting your test spec.

@eric-milles
Copy link
Member

ready to test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants