How to run google-java-format from Bazel?
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 25/100
- Type d'issue
- Documentation
- Clarté
- À clarifier
- Activité
- À l'abandon
- Stack technique
- java
- Domaine
- build-system
Piste de recherche
Commencez par le contexte Bazel et pre-commit dans l’issue, puis examinez Main#format(String... args) de google-java-format ainsi que le GoogleJavaFormatTest proposé. Le travail sera terminé lorsqu’un workflow Bazel documenté et reproductible exécutera le formateur sur les fichiers Java modifiés et définira le comportement de build attendu.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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?
- Langage dominant
- Java
- Étoiles
- 6.2k
- Forks
- 936
- Merge moyen
- 6 min
- PR mergées (30 j)
- 3
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de google/google-java-format
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
google/google-java-format#1094 · 1 commentaire ·
-
Complementary Teamups Ouverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 15/100
google/google-java-format#1450 · 1 réaction ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
google/google-java-format#1439 · 1 commentaire ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 62/100
google/google-java-format#1436 · 2 commentaires ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 48/100
google/google-java-format#1428 · 4 commentaires ·
Toutes les issues de google/google-java-format
Issues similaires
-
executions.Query — startDate and timeRange filters are sent with inverted comparison operators Ouvertearea/plugin
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
kestra-io/plugin-kestra#190 ·
-
litertlm-android AAR ships no consumer ProGuard rules → "mid == null" SIGABRT in minified apps Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
Add canonical URLs and a sitemap Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
apache/rocketmq-dashboard#5064 ·