google / google/google-java-format

Remove parentheses for single parameter lambda

Đang mở
#762 2 bình luận 2 reaction 0 người được giao Xem trên GitHub
non-whitespace
Ngôn ngữ chính
Java
Star
6.2k
Fork
937
Merge trung bình
6 phút
Pull request đã merge (30 ngày)
3

Mô tả

I understand this is probably against the design philosophy, but I would like to get it confirmed if that is the case.

It is generally considered to be a bette practice omitting parentheses for single parameter lambda, for example `foo -> ...` is better than `(foo) -> ...`, from readability perspective.

I tried hacking around and could get it to work, but I had to ignore a token by adding a new method to `OpsBuilder`, so either I'm doing something wrong or this is very much against the design philosophy (respecting original input as much as possible, IIUC).

Could you please help me understand whether this is a valid feature request or not? Thank you very much.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

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.