Indentation of `clojure.test/are`

Đang mở
#548 8 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
clojure, emacs-lisp
Lĩnh vực
tooling

Hướng nghiên cứu

Tái hiện các ví dụ clojure.test/are bằng các quy tắc thụt lề của clojure-mode với aggressive-indent-mode, sau đó so sánh chúng với M-x cider-format và lein cljfmt. Truy theo các điểm vào thụt lề của clojure-mode và xác định xem khoảng trắng thừa có thể được cấu hình hoặc làm cho nhất quán hay không; hoàn tất khi các form được hiển thị sử dụng cách thụt lề khớp nhau.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Emacs Lisp
Star
1k
Fork
249
Merge trung bình
1 ngày 6 giờ
Pull request đã merge (30 ngày)
6

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của clojure-emacs/clojure-mode

Tất cả issue của clojure-emacs/clojure-mode

Issue tương tự

Thêm issue về DevTools

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.