Fork me on GitHub
#spacemacs
<
2020-06-09
>
nmkip22:06:25

I need some help with in indentation configuration. Current:

(defexpect date-time-tests
  (expecting "String conversions"
             (expect #inst "2020-04-05T22:28:12.000" (->date-time "2020-04-05T22:28:12.000Z"))
             (expect #inst "2020-12-31T23:59:59.999" (->date-time "2020-12-31T23:59:59.999Z"))))
Wanted:
(defexpect date-time-tests
  (expecting "String conversions"
    (expect #inst "2020-04-05T22:28:12.000" (->date-time "2020-04-05T22:28:12.000Z"))
    (expect #inst "2020-12-31T23:59:59.999" (->date-time "2020-12-31T23:59:59.999Z"))))
Any ideas on how to config spacemacs for my needs?

nmkip22:06:37

;; Auto-indent code automatically
  ;; 
  (add-hook 'clojure-mode-hook #'aggressive-indent-mode)

  ;; Indentation of function forms
  ;; 
  (setq clojure-indent-style 'align-arguments)

  ;; Vertically align s-expressions
  ;; 
  (setq clojure-align-forms-automatically t)

nmkip22:06:38

I commented those 3, but default indentation is still the one I passed as current . Maybe it's some clojure layer variable?

nmkip22:06:12

(setq clojure-indent-style 'always-indent) this worked

zane02:06:38

Note that that’ll indent other forms like -> in ways that violate the community style guide (which may or may not be a problem for you 🙂).

zane02:06:37

If you want to avoid that you can use https://docs.cider.mx/cider/config/indentation.html#macro-indentation to tell CIDER what to do with expecting in particular.

nmkip13:06:40

I tried that! But it didn't work 😞 probably I was doing something wrong

nmkip13:06:19

(define-clojure-indent
  (-> 1)
  (->> 1))
tried using that

zane17:06:48

Oh, what I meant was that you should use define-clojure-indent instead of clojure-indent-style.

zane17:06:55

So you’d leave clojure-indent-style set to always-align, and then (put-clojure-indent 'expecting 2).