google / google/google-java-format

Failed reformatting on simultaneous declarations

Đang mở
#104 3 bình luận 0 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ả

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

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.