Skip to content

Checkstyle - WhitespaceAround: '{' is not preceded with whitespace. #686

Closed
@jameshearttech

Description

@jameshearttech

We are using prettier 3.3.3 and prettier-plugin-java 2.6.4. We are also using checkstyle with the config from the prettier-plugin-java repository. We have some java files that contains labeled blocks. checkstyle and prettier disagree on the formatting of curly braces for the labeled blocks. prettier formats the labeled blocks with no space between the : and {, but checkstyle complains about it.

public class Example {
    public static void main(String[] args) {
        label:{
            doStuff();
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions