You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beam.apache.org by Łukasz Gajowy <lg...@apache.org> on 2019/04/09 09:57:09 UTC

Spotless check on build.gradle files

Hi,

it seems that spotless doesn't check build.gradle files if
applyGroovyNature() is not used in them. We noticed this during code review
- spotless succeeded despite improper indentation in a build.gradle file.
IMO, such files should be checked by default, so I created an issue for
this: https://issues.apache.org/jira/browse/BEAM-7040 (currently, no
one's assigned)

Łukasz

Re: Spotless check on build.gradle files

Posted by Łukasz Gajowy <lg...@apache.org>.
Yes - the way it works now is that the groovy spotless configuration is not
used until the "applyGroovyNature()" is explicitly invoked in a
build.gradle file. IMO the spotless config should be "on" for all groovy
files in the project by default (build.gradle's included), even if
applyGroovyNature() is not used.

Maybe it's a good idea to move groovy spotless configuration to a global
scope gradle config? Notice, that all SDKs have build.gradle files that use
Groovy. However, this will require applying "com.diffplug.gradle.spotless"
and "groovy" plugins to the whole project (spotless groovy configuration
requires the groovy plugin). I don't know yet if this is acceptable.

Other than that, I noticed that we don't use spotless validation for our
.test_infra/jenkins files. I think they should be checked too.

Let me know what you think!

Best,
Łukasz




śr., 10 kwi 2019 o 01:25 Pablo Estrada <pa...@google.com> napisał(a):

> Thanks Lukasz.
>
> It seems that there's a spotless task added to applyGroovyNature:
> https://github.com/apache/beam/blob/0868e7544fd1e96db67ff5b9e70a67802c0f0c8e/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy#L1346-L1355
>
> Perhaps it's missing some more conditions?
> -P.
>
> On Tue, Apr 9, 2019 at 2:57 AM Łukasz Gajowy <lg...@apache.org> wrote:
>
>> Hi,
>>
>> it seems that spotless doesn't check build.gradle files if
>> applyGroovyNature() is not used in them. We noticed this during code review
>> - spotless succeeded despite improper indentation in a build.gradle file.
>> IMO, such files should be checked by default, so I created an issue for
>> this: https://issues.apache.org/jira/browse/BEAM-7040 (currently, no
>> one's assigned)
>>
>> Łukasz
>>
>

Re: Spotless check on build.gradle files

Posted by Pablo Estrada <pa...@google.com>.
Thanks Lukasz.

It seems that there's a spotless task added to applyGroovyNature:
https://github.com/apache/beam/blob/0868e7544fd1e96db67ff5b9e70a67802c0f0c8e/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy#L1346-L1355

Perhaps it's missing some more conditions?
-P.

On Tue, Apr 9, 2019 at 2:57 AM Łukasz Gajowy <lg...@apache.org> wrote:

> Hi,
>
> it seems that spotless doesn't check build.gradle files if
> applyGroovyNature() is not used in them. We noticed this during code review
> - spotless succeeded despite improper indentation in a build.gradle file.
> IMO, such files should be checked by default, so I created an issue for
> this: https://issues.apache.org/jira/browse/BEAM-7040 (currently, no
> one's assigned)
>
> Łukasz
>