-
Notifications
You must be signed in to change notification settings - Fork 4
[DRAFT] Issue #193 - rule 3 alignment edge cases #195
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
base: master
Are you sure you want to change the base?
Conversation
@@ -2336,3 +2336,135 @@ com.example.my-app) | |||
:ccc | |||
:ddd} | |||
--Expected | |||
|
|||
# GitHub Issue #193 - rule 3 alignment for unquote |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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