How to run google-java-format from Bazel?
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 25/100
- Issue 類型
- 文件
- 描述清晰度
- 需要釐清
- 活躍度
- 停滯
- 技術堆疊
- java
- 領域
- build-system
研究方向
先從 issue 中的 Bazel 和 pre-commit 脈絡開始,接著檢查 google-java-format 的 Main#format(String... args) 以及提議的 GoogleJavaFormatTest。完成條件是提供一個有文件記錄且可重現的 Bazel 工作流程,對已變更的 Java 檔案執行 formatter,並定義預期的 build 行為。
由索引模型根據 Issue 內容生成。
描述
I would like to run google-java-format in an (open source) project which uses Bazel as build system.
I currently have it set up using https://github.com/dustinsand/pre-commit-jvm (with https://pre-commit.com) but it strikes me as "odd" having to install https://get-coursier.io and relying on dustinsand/pre-commit-jvm when it should be possible to "just" have a (Maven) dependency on this in Bazel and "run it" - I'm just not entirely sure HOW one would be run a Java based tool like this one from Bazel...
... I have briefly explored something like what this post on bazel-discuss may have been after, and started to write my own GoogleJavaFormatTest using this project's API, but it doesn't seem to be intended to used like that (UsageException is package local only, even though Main#format(String... args) throws UsageException) - and integrated this as a b test //... is perhaps that's the wrong way to go about this anyway?
How would one best run google-java-format from Bazel? You would want it "run whenever any *.java changed", and one would want it to fail the build if the formatting was wrong - but re-write (correct) the source files. Is this possible with Bazel? How does one even "run a main() method from a dependency" for something like this?
@cushon perhaps you have some wise guidance?
- 主要語言
- Java
- 星號
- 6.2k
- 分支
- 940
- 平均合併
- 5 分鐘
- 30 天內合併 PR
- 7
環境準備
- 沒有 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 天內回覆
-
難度 3/5 1-2 天 新手友好度 55/100
google/google-java-format#1478 · 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 於 58 天前認領,目前沒有進行中的 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 於 67 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 62/100
google/google-java-format#1436 · 2 則留言 ·
維護者通常 1 天內回覆
查看 google/google-java-format 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 86/100
apache/rocketmq-dashboard#6331 ·
維護者通常 5 天內回覆
-
status: team-only type: dependency-upgrade
難度 2/5 1-3 小時 新手友好度 68/100
spring-projects/spring-boot#52143 · 1 則留言 ·
維護者通常 1 天內回覆
-
area/frontend good first issue kind/cooldown
難度 2/5 1-3 小時 新手友好度 78/100
kestra-io/kestra#20704 · 1 則留言 ·
維護者通常 1 天內回覆