clj-commons / clj-commons/formatter

Formatting map literals

Open
#7 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
35
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Should map values be aligned, or should they have a single space between keys and values? E.g.:

```clj
{:a 1
:xyz 2}

;; or

{:a 1
:xyz 2}
```

Do we want to control formatting of whitespace within a map values at all? (probably)
How do we handle formatting maps when you have several but not all key-value pairs on the same line?
How do we handle formatting maps when the value is put on the line below the key? e.g.

```
{:a 1
:b
2}

;; or

{:a 1
:b
2}
```

Aligning map values may lead to more readable code (at least for some people) but can introduce more churn in source control diffs as keys are added and removed over time. There are often ways to remove whitespace from diff views, but this may still be an issue for some people.

Contributor guide

No contributing guide indexed for this repository

Research direction

No files, tests, or entry points are identified in the issue. Start by resolving the formatting policy for aligned and multiline map values, including mixed inline and multiline pairs. Done means the behavior is specified clearly enough to implement and verify.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.