Fork me on GitHub
#clara
<
2020-01-13
>
bartuka11:01:39

hi, you guys have customized cider to understand rules indentation correctly?

wparker13:01:15

I don’t, I think some others may have experimented with it as well as an attempt to format/highlight in Cursive. I’ve personally just used newlines for new conditions and Cider indents that well enough that it hasn’t bothered me.

wparker13:01:25

Is there something in particular that looks strange to you?

bartuka22:01:48

the default indentation looks like this:

bartuka22:01:53

(defrule rule->legacy-contract?
  "Add a Legacy fact into the session if the contract was sent with this status."
  [?contract <- Contract [ct] (= ?principal-external-id (:contract/principal-external-id ct))
   (= :legacy (:contract/status ct))]
  =>
  (insert! (->Legacy ?principal-external-id)))

bartuka22:01:25

and I have to manually change it to:

(defrule rule->legacy-contract?
  "Add a Legacy fact into the session if the contract was sent with this status."
  [?contract <- Contract [ct] (= ?principal-external-id (:contract/principal-external-id ct))
                              (= :legacy (:contract/status ct))]
  =>
  (insert! (->Legacy ?principal-external-id)))

bartuka23:01:31

sometimes I need to use M-x align-regexp (= to align the conditions