Skip to content

midje.tabular form indentation #282

Closed
@timvisher

Description

@timvisher

I can't make clojure-mode indent midje's tabular form correctly. I may be (read: almost certainly am) missing something, but it looks like it could be a bug in how clojure-mode is indenting maps.

I want things to look like:

(fact-group "charnock"
  (tabular
    (fact "depends on charnock with optional whitefield, piper, carson, wesley, calvin"
      (dependencies ?spec => ?expected)
    ?spec                                    ?expected
    {:spec-type          :theologians
     :charnock-column-id "charnock"}         #{"charnock"}
    {:spec-type          :theologians
     :charnock-column-id "current_charnock"} #{"current_charnock"}
    {:spec-type            :theologians
     :charnock-column-id   "charnock"
     :whitefield-column-id "whitefield"}     #{"charnock" "whitefield"}
    {:spec-type            :theologians
     :charnock-column-id   "charnock"
     :whitefield-column-id "whitefield"
     :piper-column-id      "piper"}          #{"charnock" "whitefield" "piper"}
    {:spec-type            :theologians
     :charnock-column-id   "charnock"
     :whitefield-column-id "whitefield"
     :piper-column-id      "piper"
     :carson-column-id     "carson"}         #{"charnock" "whitefield" "piper" "carson"}
    {:spec-type            :theologians
     :charnock-column-id   "charnock"
     :whitefield-column-id "whitefield"
     :piper-column-id      "piper"
     :carson-column-id     "carson"
     :wesley-column-id     "wesley"}         #{"charnock" "whitefield" "piper" "carson" "wesley"}
    {:spec-type            :theologians
     :charnock-column-id   "charnock"
     :whitefield-column-id "whitefield"
     :piper-column-id      "piper"
     :carson-column-id     "carson"
     :wesley-column-id     "wesley"
     :calvin-column-id     "calvin"}         #{"charnock" "whitefield" "piper" "carson" "wesley" "calvin"}))

While instead they look like this:

(fact-group "charnock"
  (tabular
   (fact "depends on charnock with optional whitefield, piper, carson, wesley, calvin"
     (dependencies ?spec => ?expected)
     ?spec                                    ?expected
     {:spec-type          :theologians
      :charnock-column-id "charnock"}         #{"charnock"}
      {:spec-type          :theologians
       :charnock-column-id "current_charnock"} #{"current_charnock"}
       {:spec-type            :theologians
        :charnock-column-id   "charnock"
        :whitefield-column-id "whitefield"}     #{"charnock" "whitefield"}
        {:spec-type            :theologians
         :charnock-column-id   "charnock"
         :whitefield-column-id "whitefield"
         :piper-column-id      "piper"}          #{"charnock" "whitefield" "piper"}
         {:spec-type            :theologians
          :charnock-column-id   "charnock"
          :whitefield-column-id "whitefield"
          :piper-column-id      "piper"
          :carson-column-id     "carson"}         #{"charnock" "whitefield" "piper" "carson"}
          {:spec-type            :theologians
           :charnock-column-id   "charnock"
           :whitefield-column-id "whitefield"
           :piper-column-id      "piper"
           :carson-column-id     "carson"
           :wesley-column-id     "wesley"}         #{"charnock" "whitefield" "piper" "carson" "wesley"}
           {:spec-type            :theologians
            :charnock-column-id   "charnock"
            :whitefield-column-id "whitefield"
            :piper-column-id      "piper"
            :carson-column-id     "carson"
            :wesley-column-id     "wesley"
            :calvin-column-id     "calvin"}         #{"charnock" "whitefield" "piper" "carson" "wesley" "calvin"}))

Notice how it almost looks like each consecutive top-level pair is being interpreted as if it should be inside the previous map? That's what leads me to think it's a bug.

The relevant config I've done might be:

(put-clojure-indent 'fact-group 1)
(put-clojure-indent 'fact 1)
(put-clojure-indent 'tabular nil)

Where I had tried other values for 'tabular (1 and 2).

I'm happy to try to provide anything I can that would help get this fixed.

Thanks as always for your hard work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions