Skip to content

Map indentation option when key and value are on separate lines #2547

@awebneck

Description

@awebneck

Currently, when using the "Align map values" code style option, the alignment takes place even when then key and value are on separate lines. For a map such as the following:

{:some-key "some-value"
 :some-other-key "some-other-value"
 :yet-another-key
"yet-another-value"}

This results in the formatting change

{:some-key       "some-value"
 :some-other-key "some-other-value"
 :yet-another-key
                 "yet-another-value"}

I'd love to see an option whereby a value on a newline relative to its key is not aligned. Typically, the rationale behind having a map so formatted is because the value itself extends past the general standard column 80 wrap point, and placing it on a newline (aligned directly beneath its key) is preferable to having it violate that standard. As-is, in such maps, I cannot rely on the code styler and have to continuously override it to allow this syntax. Having the option would save me a lot of headache. With this new proposed option enabled, the above map would be formatted as:

{:some-key       "some-value"
 :some-other-key "some-other-value"
 :yet-another-key
 "yet-another-value"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    changedMarks issues describing changes to existing featuresreleasedMarks issues which have had the fixes released in a stable build

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions