Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

When Javadoc formatting is disabled, don't change javadoc so much

未關閉
#789 4 則留言 7 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
30/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
java
領域
tooling

研究方向

先追蹤現有的 --skip-javadoc-formatting 選項和 Javadoc 格式化路徑。將其目前的行為與要求的完全停用模式及提議的選擇性格式化選項進行比較;「done」應包含明確定義的選項語義,以便在停用格式化時保留 Javadoc 內容和縮排。

由索引模型根據 Issue 內容生成。

描述

Javadoc formatting regularly gives undesired results and lags behind in its support for both Javadoc (esp. {@snippet ...}) and HTML (e.g. elements such as <section>, <article>, <figure>, <figcaption>, ... aren't properly supported, nor is wrapping a "block" with an <a> element, etc.).

With --skip-javadoc-formatting, the result is unusable as well, because indentation is still removed.

So because of the poor Javadoc formatting, and the inability to disable it altogether, it's impractical to format my Java code with GJF.

I propose to at least provide an option to disable Javadoc formatting altogether (i.e. not even adding asterisks or doing any alignment/indentation changes). Either by updating the semantics of --skip-javadoc-formatting, or by introducing a new option (e.g. --disable-javadoc-formatting).

It would also be helpful to have an option where GJF only formats pure Javadoc (i.e. anything within {@... } and lines that start with a tag) and leaves anything else untouched (with an additional option to specify tags to exclude, such as @snippet while it's unsupported).

主要語言
Java
星號
6.2k
分支
936
平均合併
6 分鐘
30 天內合併 PR
3

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

google/google-java-format 的其他 Issue

查看 google/google-java-format 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。