Groovy formatting is very limited - possible idea
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
Línea de trabajo
Empieza leyendo las directrices de contribución y el formateador de Groovy existente que utiliza Eclipse formatter. Compara su contrato de formateo de un solo archivo con los modos propuestos de línea de comandos dry-run y format de IntelliJ Community Edition, incluidos los aspectos relacionados con los archivos temporales y los procesos externos. Se consideraría completado cuando exista una forma acordada y mantenible de mejorar el formateo de Groovy y Spock en Spotless.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
The current Groovy formatting using the Eclipse formatter is very limited. It can't even format apply({println it }) into something stringent. Let alone Spock tests written in Groovy.
The ways to format Groovy code are very limited. There is a npm-groovy-lint. That works better as the Eclipse formatter but has it own flaws (multi-line strings, ...). And fails on Spock tests, too.
My idea would be to use the IntelliJ formatter of the freely available community edition.
Here's the catch.
That's a command line tool that has the necessary two working options.
dry-run - just like spotless:check - checks a file or the files in a folder if they conform the expected formatting. If not, the files are reported.
format - just like spotless:apply - formats a file or the files in a folder.
After reading the contribution guideline I think this IntelliJ approach fits hardly into the Spotless Formatter approach, where one single file is given into the method and the formatted result is returned.
Of course it's possible to write the file content into a temporary file, call IntelliJ format on that temporary file, read the file again and return it's result.
I believe that's very cumbersome - especially on Windows with limited NTFS.
The necessary IntelliJ files could be packaged and provided as Maven dependency and then started as external process.
Is there a way to achieve better Groovy formation with Spotless?
(Of course, IntelliJ could format many other file types, too, but I'm mainly interested in Groovy.)
- Lenguaje dominante
- Java
- Estrellas
- 5.7k
- Forks
- 560
- Merge medio
- 1 d 13 h
- PR fusionados (30 d)
- 43
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de diffplug/spotless
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 66/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
Todos los issues de diffplug/spotless
Issues similares
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
apache/cloudstack#14222 ·
-
[BUG]茶杯方块在取茶时会引发崩溃 Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
Cannot differ own consent and managed consents in My Consents view and detailed consent view. Abierto1.0.0-alpha2 Type/Improvement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
wso2/dpdp-accelerator#272 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
apache/rocketmq-dashboard#4860 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
infinispan/infinispan#18150 ·