google / google/google-java-format

Failed reformatting on simultaneous declarations

Ouverte
#104 3 commentaires 0 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

Hi there,

I meet a problem when trying to use google-java-format to re-format on simultaneous declarations in a java file:

According to Google Java Style Guide [4.8.2-variable-declarations](https://google.github.io/styleguide/javaguide.html#s4.8.2-variable-declarations):

>Every variable declaration (field or local) declares only one variable: declarations such as `int a, b;` are not used.

However, given java file:

```java
public class ReplaceColor {
private int oldRed, oldGreen, oldBlue;
private IntRange oldRedRange, oldGreenRange, oldBlueRange;
private boolean isRange;
}
```

using google-java-format would not re-format the simultaneous declarations in above file.

Is this a defect that google-java-format forget to consider about?

If not, could you guys help me a bit on pointing out where should I getting started to hack this project to get this feature in my own fork?

Many thanks & best wishes,

Charles

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.