google-java-format test?

255 views
Skip to first unread message

Han-Wen Nienhuys

unread,
Mar 21, 2017, 6:52:14 AM3/21/17
to bazel-...@googlegroups.com
Hi there,

anyone aware of a Skylark rule that would run all .java files in a
project through google-java-format to check for formatting errors?

--

Google Germany GmbH, Erika-Mann-Strasse 33, 80363 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle

Damien Martin-Guillerez

unread,
Mar 21, 2017, 6:53:25 AM3/21/17
to Han-Wen Nienhuys, bazel-...@googlegroups.com
I would be interested to have that for Bazel too :)

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/CAFQ2z_NnyhKoEh07bdm5LycSQVLUySnOYQwczyeVPpS1hZVApA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Han-Wen Nienhuys

unread,
Mar 21, 2017, 10:31:13 AM3/21/17
to Damien Martin-Guillerez, bazel-...@googlegroups.com
I made this: https://gerrit-review.googlesource.com/c/100691/

however, it is monolithic, and I think this would better be solved
with aspects. Do you have a suggestion for how to change this? Can we
apply aspects without using command line flags?
--
Han-Wen Nienhuys
Google Munich
han...@google.com

Dmitry Lomov

unread,
Mar 21, 2017, 10:56:38 AM3/21/17
to Han-Wen Nienhuys, Damien Martin-Guillerez, bazel-...@googlegroups.com
On Tue, Mar 21, 2017 at 3:30 PM, 'Han-Wen Nienhuys' via bazel-discuss <bazel-...@googlegroups.com> wrote:
I made this: https://gerrit-review.googlesource.com/c/100691/

however, it is monolithic, and I think this would better be solved
with aspects. Do you have a suggestion for how to change this? Can we
apply aspects without using command line flags?

Aspects sound right. If you do not want command line flags, you can write a custom rule originating the aspect and build that target.
 

On Tue, Mar 21, 2017 at 11:53 AM, Damien Martin-Guillerez
<dmar...@google.com> wrote:
> I would be interested to have that for Bazel too :)
>
> On Tue, Mar 21, 2017 at 6:52 AM 'Han-Wen Nienhuys' via bazel-discuss
> <bazel-discuss@googlegroups.com> wrote:
>>
>> Hi there,
>>
>> anyone aware of a Skylark rule that would run all .java files in a
>> project through google-java-format to check for formatting errors?
>>
>> --
>>
>> Google Germany GmbH, Erika-Mann-Strasse 33, 80363 Munich
>>
>> Registergericht und -nummer: Hamburg, HRB 86891
>>
>> Sitz der Gesellschaft: Hamburg
>>
>> Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "bazel-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
Han-Wen Nienhuys
Google Munich
han...@google.com
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/CAFQ2z_OMSHMXDmQG3%3DAEdWEJE9VP%2BSBmHfmcGf1NnFM1KPtOKA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--
Google Germany GmbH
Erika-Mann-Straße 33, 80636 München, Germany

Han-Wen Nienhuys

unread,
Mar 21, 2017, 10:59:25 AM3/21/17
to Dmitry Lomov, Damien Martin-Guillerez, bazel-...@googlegroups.com
But I would still have to generate one rule of that aspect per
java_library? Or can I force an aspect to be instantiated for all
java_libraries in //... ?
>> >> email to bazel-discus...@googlegroups.com.
>> >> To view this discussion on the web visit
>> >>
>> >> https://groups.google.com/d/msgid/bazel-discuss/CAFQ2z_NnyhKoEh07bdm5LycSQVLUySnOYQwczyeVPpS1hZVApA%40mail.gmail.com.
>> >> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Han-Wen Nienhuys
>> Google Munich
>> han...@google.com
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "bazel-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to bazel-discus...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/bazel-discuss/CAFQ2z_OMSHMXDmQG3%3DAEdWEJE9VP%2BSBmHfmcGf1NnFM1KPtOKA%40mail.gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
> Google Germany GmbH
> Erika-Mann-Straße 33, 80636 München, Germany



Dmitry Lomov

unread,
Mar 21, 2017, 11:03:33 AM3/21/17
to Han-Wen Nienhuys, Damien Martin-Guillerez, bazel-...@googlegroups.com
On Tue, Mar 21, 2017 at 3:59 PM, Han-Wen Nienhuys <han...@google.com> wrote:
But I would still have to generate one rule of that aspect per
java_library? Or can I force an aspect to be instantiated for all
java_libraries in //... ?

I see, no, only command line has the power to apply to //... 

>> >> To view this discussion on the web visit
>> >>
>> >> https://groups.google.com/d/msgid/bazel-discuss/CAFQ2z_NnyhKoEh07bdm5LycSQVLUySnOYQwczyeVPpS1hZVApA%40mail.gmail.com.
>> >> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Han-Wen Nienhuys
>> Google Munich
>> han...@google.com
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "bazel-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an

>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/bazel-discuss/CAFQ2z_OMSHMXDmQG3%3DAEdWEJE9VP%2BSBmHfmcGf1NnFM1KPtOKA%40mail.gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
> Google Germany GmbH
> Erika-Mann-Straße 33, 80636 München, Germany



--
Han-Wen Nienhuys
Google Munich
han...@google.com
Reply all
Reply to author
Forward
0 new messages