google / google/google-java-format

Java or Java-like files with alternate extensions are skipped.

未關閉
#769 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Java
星號
6.2k
分支
937
平均合併
6 分鐘
30 天內合併 PR
3

描述

Main.java has a very simple path extension check.

```java
for (String fileName : parameters.files()) {
if (!fileName.endsWith(".java")) {
errWriter.println("Skipping non-Java file: " + fileName);
continue;
}
```

Is there any reason alternate file extensions can't be formatting/supported? You can somewhat get around this by using standard input formatting and --assume-filename, so you can get around this with some additional tooling, but the restriction on the extension seems to be more out of an abundance of caution for throwing mixed source directories and folder structures.

My original intention was to see how well GJF does on AIDL files which kicked of my investigation into my options.

貢獻指南

開啟貢獻指南

研究方向

從 Main.java 中 issue 所示的路徑副檔名檢查開始,檢視帶有 --assume-filename 的標準輸入目前如何處理替代名稱。確定對類似 Java 的副檔名所支援的行為,然後為選定的情況新增涵蓋範圍,並確認一般的非 Java 檔案仍會被略過。

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

評估

技術堆疊
java
領域
tooling
Issue 類型
功能
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
45/100

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

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