Indentation of `clojure.test/are`

未關閉
#548 8 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
clojure, emacs-lisp
領域
tooling

研究方向

使用 aggressive-indent-mode,依照 clojure-mode 的縮排規則重現 clojure.test/are 範例,然後將它們與 M-x cider-format 和 lein cljfmt 比較。追蹤 clojure-mode 的縮排進入點,並判斷額外的空格是否可以設定或使其一致;當顯示的形式使用相符的縮排時,即表示完成。

由索引模型根據 Issue 內容生成。

描述

Expected behavior

I was expecting clojure-mode's indentation to behave similar to cider-format and lein cljfmt. Is there some way to configure clojure-mode to indent the same way as cider-format?

Actual behavior

The macro clojure.test/are is indented one way with M-x cider-format (and lein cljfmt), but another way when using clojure-mode's indentation rules (with aggressive-indent-mode). The latter uses one space less than the former for the second argument to are (when it is on a new line).

Steps to reproduce the problem

The code is formatted as following using clojure-mode indentation:

(deftest are-test
  (are [x y]
      (= x y)
    1 1
    2 2))

And as following when using cider-format indentation (note the extra space on line 3):

((deftest are-test
  (are [x y]
       (= x y)
    1 1
    2 2))

Environment & Version information

clojure-mode version information
clojure-mode (version 5.11.0)
Emacs version
GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.12, cairo version 1.17.3) of 2019-11-26
Operating system

Arch Linux

主要語言
Emacs Lisp
星號
1k
分支
249
平均合併
1 天 6 小時
30 天內合併 PR
6

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

clojure-emacs/clojure-mode 的其他 Issue

查看 clojure-emacs/clojure-mode 的全部 Issue

相似的 Issue

更多 DevTools Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。