Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keyword in destructuring forced to be smashed against bracket #245

Open
MicahElliott opened this issue Feb 2, 2022 · 2 comments
Open

keyword in destructuring forced to be smashed against bracket #245

MicahElliott opened this issue Feb 2, 2022 · 2 comments

Comments

@MicahElliott
Copy link

MicahElliott commented Feb 2, 2022

This is what cljfmt wants:

(defn foo
  [{:keys [aa
           ;; bb
           ]:as context} ; whitespace problem here

But obviously a space is wanted before the :as.

This is an important problem because it's common that a map key (eg, bb) is no longer used but should still be listed since a future developer want to see that bb is/was indeed a usable piece of the inputs.

@weavejester
Copy link
Owner

Can you provide the "before" code as well?

@or
Copy link
Contributor

or commented May 10, 2022

I can reproduce this with default options:

(defn foo
  [{:keys [aa
           ;; bb
           ] :as context}]
   (foobar))

(defn foo
  [{:keys [aa
           ] :as context}]
   (foobar))

formats to:

(defn foo
      [{:keys [aa
           ;; bb
               ]:as context}]
      (foobar))

(defn foo
      [{:keys [aa] :as context}]
      (foobar))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants