google / google/google-java-format

Remove parentheses for single parameter lambda

Ouverte
#762 2 commentaires 2 réactions 0 personnes assignées Voir sur GitHub
non-whitespace
Langage dominant
Java
Étoiles
6.2k
Forks
937
Merge moyen
6 min
PR mergées (30 j)
3

Description

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.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.