[DRAFT] Issue #193 - rule 3 alignment edge cases#195
Conversation
| :ddd} | ||
| --Expected | ||
|
|
||
| # GitHub Issue #193 - rule 3 alignment for unquote |
There was a problem hiding this comment.
Might be a good idea to add test cases for all the expression prefixes individually -
'quote
`syntax-quote
~unquote
~@unquote-splicing
@deref
There was a problem hiding this comment.
Oops, missed one case:
#'var
There are also symbolic constants, namespaced map syntax , tagged literals and conditional read forms if you really want to cover all edge cases:
##NaN
## NaN
#:user{:a 1}
#:user {:a 1}
#::u{:a 1}
#::u {:a 1}
#::{:a 1}
#:: {:a 1}
#inst "2014-05-19T19:12:37.925-00:00"
#js{:onClick (fn [e] (js/console.log e))}
#?(:clj true :cljs false}
#? (:clj true :cljs false}
#?@(:clj [:a :b :c])
#?@ (:clj [:a :b :c])Note that Rule 3 is currently triggered incorrectly for the above cases when there is whitespace between the dispatch character(s) and form, which standard-clojure-style preserves (although maybe it shouldn't? will open a separate issue)
There was a problem hiding this comment.
Oh, and the obscure reader eval macro which isn't even documented on https://clojure.org/guides/weird_characters
#=(* 2 3)
#= (* 2 3)
I think this one is really unlikely to show up in source files
There was a problem hiding this comment.
Thank you for this @yuhan0! I created Issue #198 for discussion around whether Standard Clojure Style should remove or persist whitespace for these cases.
Issue #193