diffplug / diffplug/spotless

Allow spotless greclipse.properties to be selected via configuration

Abierto
#901 1 comentario 3 reacciones 0 asignados Ver en GitHub
enhancement
Lenguaje dominante
Java
Estrellas
5.6k
Forks
559
Merge medio
1 d 14 h
PR fusionados (30 d)
43

Descripción

The default formatting configuration of `greclipse` isn't very standard or desirable. However, spotless configures [`greclipse.properties`](https://github.com/diffplug/spotless/blob/main/testlib/src/main/resources/groovy/greclipse/format/greclipse.properties) in a much more standard way.

For example, compare the default formatting of `googleJavaFormat` to `greclipse`. They're very different.

If you Google `site:github.com "greclipse.properties"`, you will find that many projects simply copied this file as defined by spotless.

Instead of having to copy `greclipse.properties` into every project, it'd be sweet if we could just select this formatting configuration by spotless via configuration, for example:
```xml

spotless

```

EDIT:
Unfortunately, I spoke too soon. I didn't realize spotless's [`greclipse.properties`](https://github.com/diffplug/spotless/blob/main/testlib/src/main/resources/groovy/greclipse/format/greclipse.properties) sets the following (I assume for testing):
```properties
groovy.formatter.braces.start=next
groovy.formatter.braces.end=same
```

These settings aren't very typical. I propose the following settings to stay consistent with [`googleJavaFormat`](https://google.github.io/styleguide/javaguide.html) as well as with examples on the [Groovy style guide](https://groovy-lang.org/style-guide.html):
```properties
groovy.formatter.braces.end=next
groovy.formatter.braces.start=same
groovy.formatter.longListLength=100
groovy.formatter.multiline.indentation=4
groovy.formatter.remove.unnecessary.semicolons=true
org.eclipse.jdt.core.formatter.indent_empty_lines=false
org.eclipse.jdt.core.formatter.tabulation.char=space
org.eclipse.jdt.core.formatter.tabulation.size=2
```

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza examinando testlib/src/main/resources/groovy/greclipse/format/greclipse.properties y el punto de entrada de la configuración del formateador greclipse. Compara las propiedades de Spotless referenciadas con los ajustes revisados en el issue y determina cómo se puede seleccionar una configuración con nombre. Se considera terminado cuando los proyectos pueden elegir la configuración sin copiar el archivo de propiedades y el formato resultante coincide con los ajustes documentados.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
groovy, java
Área
build-system, tooling
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.