Skip to content

Incorrect formatting for long annotations #159

@vgarg

Description

@vgarg

In case of long annotations e.g.

@Bean(with="foo", many="bar", arguments="baz", so={"that", "this", "line", "is", "long"})

The formatter automatically line wraps it as:

@Bean(
  with = "foo",
  many = "bar",
  arguments = "baz",
  so = {"that", "this", "line", "is", "long"}
)

The issue is that the wrapped lines are indented using 2 spaces instead of 4 as described in the Google Java Styles:
When line-wrapping, each line after the first (each continuation line) is indented at least +4 from the original line

This conflicts with CheckStyle plugin that we use as part of our Maven build. CheckStyle complains: 'with' has incorrect indentation level 2, expected level should be 4. (16:0)

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