google / google/google-java-format

Remove parentheses for single parameter lambda

未关闭
#762 2 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看
non-whitespace
主要语言
Java
星标
6.2k
派生
937
平均合并
6 分钟
30 天内合并 PR
3

描述

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.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。