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

Unexpected indentation in multi-arity defn #99

Closed
alexandercampbell opened this issue Sep 28, 2024 · 2 comments
Closed

Unexpected indentation in multi-arity defn #99

alexandercampbell opened this issue Sep 28, 2024 · 2 comments
Labels
bug Something isn't working v1 blocker Required for a v1.0.0 release

Comments

@alexandercampbell
Copy link

This file:

(ns example)

(defn rgb->css
  ([r g b] (str "rgb(" r "," g "," b ")"))
  ([r g b a] (str "rgba(" r "," g "," b "," a ")")))

lIs reformatted by standard-clj v0.4.1 like so:

(ns example)

(defn rgb->css
  ([r g b] (str "rgb(" r "," g "," b ")"))
([r g b a] (str "rgba(" r "," g "," b "," a ")")))

I would expect the last line to be indented.

I took this example from the middle of a larger file, so I know that the odd indentation is not related to this being the last form in a file.

Notably, this altered version is correctly formatted as I expect:

(ns example)

(defn rgb->css
  ([r g b] (str))
  ([r g b a] (str)))

I suspect the bug is connected to parentheses appearing inside string literals.

I observed this behavior on v0.4.1 of the formatter.

@oakmac
Copy link
Owner

oakmac commented Sep 28, 2024

Great catch! Thank you for the helpful bug report 🤓 Fixed with PR-100

@oakmac
Copy link
Owner

oakmac commented Sep 28, 2024

This is fixed with v0.5.0

@oakmac oakmac closed this as completed Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v1 blocker Required for a v1.0.0 release
Projects
None yet
Development

No branches or pull requests

2 participants