oakmac / oakmac/standard-clojure-style-js

Grouping test constants in a case statement

Open
#207 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
137
Forks
8
PR merge metrics
No merged PRs in 30d

Description

When you group constants in a case statement, you use a list, which causes standard-clojure-style to indent oddly when the constants are separated by newlines:

(case x
  (:a
   :b) :c)

Will get transformed to:

(case x
  (:a
    :b) :c)

Tested with:

~/standard-clojure-style-js(master) $ echo '(case x\n  (:a\n   :b) :c)' 
(case x
  (:a
   :b) :c)
~/standard-clojure-style-js(master) $ echo '(case x\n  (:a\n   :b) :c)' | ./standard-clj fix -
(case x
  (:a
    :b) :c)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided case-statement example through ./standard-clj fix - and inspect the formatter path that handles case expressions and grouped constants. Confirm the change by ensuring the :a and :b lines retain the intended indentation without affecting other case formatting.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.