How to run google-java-format from Bazel?
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 25/100
- Issue-Typ
- Dokumentation
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- java
- Bereich
- build-system
Rechercherichtung
Beginne mit dem Bazel- und pre-commit-Kontext im Issue und sieh dir dann google-java-formats Main#format(String... args) sowie den vorgeschlagenen GoogleJavaFormatTest an. Als abgeschlossen gilt eine dokumentierte, reproduzierbare Bazel-Workflow, die den Formatter auf geänderte Java-Dateien anwendet und das erwartete Build-Verhalten definiert.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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?
- Vorherrschende Sprache
- Java
- Sterne
- 6.2k
- Forks
- 936
- Ø Merge
- 6 Min.
- Gemergte PRs (30 T.)
- 3
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus google/google-java-format
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
google/google-java-format#1094 · 1 Kommentar ·
-
Complementary Teamups Offen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 15/100
google/google-java-format#1450 · 1 Reaktion ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
google/google-java-format#1439 · 1 Kommentar ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 62/100
google/google-java-format#1436 · 2 Kommentare ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 48/100
google/google-java-format#1428 · 4 Kommentare ·
Alle Issues in google/google-java-format
Ähnliche Issues
-
documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
inu-appcenter/memorIN-backend#288 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
-
frontend maui-pilot pilot-ask question
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
executions.Query — startDate and timeRange filters are sent with inverted comparison operators Offenarea/plugin
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
kestra-io/plugin-kestra#190 ·