Inconsistent Formatting (with Interface)
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 50/100
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện đầu vào Java được cung cấp với Prettier-Java 0.5.1 và cấu hình printWidth được hiển thị, sau đó so sánh cách định dạng các khai báo lớp, interface và enum. Xác định hành vi xuống dòng dự kiến hoặc phạm vi áp dụng của tùy chọn, rồi bổ sung coverage thể hiện kết quả đã thống nhất cho các khai báo interface.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Prettier-Java 0.5.1
I'm not sure if this is the intended behavior of Prettier; Prettier adds a new line after class declarations but not after interface declarations.
overrides:
- files: ["*.java"]
options:
printWidth: 120
Input:
public interface ProjectOrBuilder extends com.google.protobuf.MessageOrBuilder {
String getModelVersion();
com.google.protobuf.ByteString getModelVersionBytes();
String getGroupId();
com.google.protobuf.ByteString getGroupIdBytes();
String getArtifactId();
com.google.protobuf.ByteString getArtifactIdBytes();
String getVersion();
}
Output:
public interface ProjectOrBuilder extends com.google.protobuf.MessageOrBuilder {
String getModelVersion();
com.google.protobuf.ByteString getModelVersionBytes();
String getGroupId();
com.google.protobuf.ByteString getGroupIdBytes();
String getArtifactId();
com.google.protobuf.ByteString getArtifactIdBytes();
String getVersion();
}
Expected behavior:
public interface ProjectOrBuilder extends com.google.protobuf.MessageOrBuilder {
String getModelVersion();
com.google.protobuf.ByteString getModelVersionBytes();
String getGroupId();
com.google.protobuf.ByteString getGroupIdBytes();
String getArtifactId();
com.google.protobuf.ByteString getArtifactIdBytes();
String getVersion();
}
I feel like if classes have new lines after their declaration, then interfaces and enums should follow the same pattern as well. An option to choose if newlines are added would be appreciated as well.
I'm not sure if this is a bug or an intended feature, however, I'm creating this issue to discuss this inconsistency in prettier.
- Ngôn ngữ chính
- Java
- Star
- 1.2k
- Fork
- 123
- Merge trung bình
- 2 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 35
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của jhipster/prettier-java
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
jhipster/prettier-java#1113 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 56/100
jhipster/prettier-java#1114 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Text block containing a comment-like line with " or \ fails with "Comment was not printed"Có thể đã có người làm @sean0407 đã nhận 1 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 66/100
jhipster/prettier-java#1112 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
JEP 401 Support value keywordĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
jhipster/prettier-java#1031 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Adds needlessly parenthesesCó thể đã có người làm @braxtonzhangio đã nhận 74 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 67/100
jhipster/prettier-java#1001 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của jhipster/prettier-java
Issue tương tự
-
ChaosEngine: backup-remote doctor row passes while consumer mode hides bot memory from gitCó thể đã có người làm @MohabMohie đã nhận hôm nay. Đang mởagentic
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
ShaftHQ/SHAFT_ENGINE#7263 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
bug/错误
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
FCL-Team/FoldCraftLauncher#1951 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
quarkusio/quarkus-agent-mcp#296 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
commons-app/apps-android-commons#7072 ·
Maintainer thường phản hồi trong vòng 1 ngày