Records with annotations on components are formatted pretty badly
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
使用 google-java-format 重現所示的 record 和 class 範例,然後比較 record 元件上的註解如何排列。從失敗的輸入開始,追蹤格式化器對 record 元件和註解的處理;當帶有註解的 record 元件能與 class 範例一致地進行格式化(包括多行註解)時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
Example output by google-java-format on a record:
public record MyRecord(
@NotNull String firstName,
String lastName,
@NotEmpty List<String> friends,
@MyAnnotation(
propA = "The brown fox jumps over the lazy cat......",
propB = 11,
type = java.lang.Object.class)
@HelloWorld
String hello,
String world,
@Positive int numberA,
@MyAnnotation(propA = "The brown fox jumps over the lazy cat", type = java.lang.Object.class)
@HelloWorld
String hello) {}
Compare to if it was a class:
public class MyClass {
@NotNull String firstName;
String lastName;
@NotEmpty List<String> friends;
@MyAnnotation(
propA = "The brown fox jumps over the lazy cat......",
propB = 11,
type = Object.class)
@HelloWorld
String hello;
String world;
@Positive int numberA;
@MyAnnotation(propA = "The brown fox jumps over the lazy cat", type = Object.class)
@HelloWorld
String hello;
}
- 主要語言
- Java
- 星號
- 6.2k
- 分支
- 940
- 平均合併
- 7 小時 46 分鐘
- 30 天內合併 PR
- 11
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
google/google-java-format 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
google/google-java-format#1094 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 35/100
google/google-java-format#1470 · 5 個 reaction ·
維護者通常 1 天內回覆
-
IndexOutOfBoundsException - Wrong formatted content when dealing with latex String可能重新可做 @Amlan2000 於 62 天前認領,目前沒有進行中的 PR。 未關閉
難度 4/5 3-5 天 新手友好度 55/100
google/google-java-format#1439 · 1 則留言 ·
維護者通常 1 天內回覆
-
unused import removal leaves extra blank line between package declaration and class Javadoc / declaration可能已有人在做 @arimu1 於 72 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 62/100
google/google-java-format#1436 · 2 則留言 ·
維護者通常 1 天內回覆
-
Eclipse
難度 3/5 1-2 天 新手友好度 48/100
google/google-java-format#1428 · 4 則留言 ·
維護者通常 1 天內回覆
查看 google/google-java-format 的全部 Issue
相似的 Issue
-
agent:working documentation enhancement go:build lane:needs-decision
難度 2/5 1-3 小時 新手友好度 72/100
Sanne/incus-spawn#1435 · 3 則留言 ·
維護者通常 1 天內回覆
-
enhancement good first issue up-for-grabs
難度 2/5 1-3 小時 新手友好度 80/100
AnikethTS/ChangeRadar#22 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
openai/openai-java#1202 ·
維護者通常 1 天內回覆
-
admin sql type: bug
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 2 天內回覆
-
library-new-request priority
難度 2/5 1-3 小時 新手友好度 70/100
oracle/graalvm-reachability-metadata#10911 · 1 則留言 ·
維護者通常 1 天內回覆