diffplug / diffplug/spotless

Enabling Parrot Parser for Groovy Eclipse

Abierto
#975 6 comentarios 0 reacciones 0 asignados Ver en GitHub
enhancement
Lenguaje dominante
Java
Estrellas
5.6k
Forks
559
Merge medio
1 d 13 h
PR fusionados (30 d)
34

Descripción

Since spotless depends on groovy-eclipse for groovy parsing/formatting, and since groovy-eclipse doesn't enable the parrot parser by default, Spotless fails when configured for groovy code that utilizes Groovy 3+ syntax.

After experiencing some pain with spotless + groovy, I stumbled upon #246 which led me to dig into groovy-eclipse. Turns out groovy-eclipse leaves the new antlr4 based Parrot Parser [disabled by default](https://github.com/groovy/groovy-eclipse/wiki/4.2.0-Release-Notes#support-for-new-versions-of-groovy), which means any newer Groovy 3 syntax that contains, for example, Java lambdas, blows up.

I can manually add `-Dgroovy.antlr4=true` to my Gradle execution and that gets it working for me locally, but there should be some way to configure this right within build.gradle? I'm trying to find a solution that is more amenable to a team environment.

In the past I've modified JavaExec tasks and the like to include forked JVM options. But there seems to be no way to do that for SpotlessTask.

Am I missing something obvious here?

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.