Inconsistent Formatting (with Interface)
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 50/100
Línea de trabajo
Comienza reproduciendo la entrada Java proporcionada con Prettier-Java 0.5.1 y la configuración de printWidth mostrada; después, compara el formato de las declaraciones de clase, interfaz y enum. Determina el comportamiento de salto de línea previsto o el alcance de la opción, y añade cobertura que muestre el resultado acordado para las declaraciones de interfaz.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Prettier-Java 0.5.1
I'm not sure if this is the intended behavior of Prettier; Prettier adds a new line after class declarations but not after interface declarations.
overrides:
- files: ["*.java"]
options:
printWidth: 120
Input:
public interface ProjectOrBuilder extends com.google.protobuf.MessageOrBuilder {
String getModelVersion();
com.google.protobuf.ByteString getModelVersionBytes();
String getGroupId();
com.google.protobuf.ByteString getGroupIdBytes();
String getArtifactId();
com.google.protobuf.ByteString getArtifactIdBytes();
String getVersion();
}
Output:
public interface ProjectOrBuilder extends com.google.protobuf.MessageOrBuilder {
String getModelVersion();
com.google.protobuf.ByteString getModelVersionBytes();
String getGroupId();
com.google.protobuf.ByteString getGroupIdBytes();
String getArtifactId();
com.google.protobuf.ByteString getArtifactIdBytes();
String getVersion();
}
Expected behavior:
public interface ProjectOrBuilder extends com.google.protobuf.MessageOrBuilder {
String getModelVersion();
com.google.protobuf.ByteString getModelVersionBytes();
String getGroupId();
com.google.protobuf.ByteString getGroupIdBytes();
String getArtifactId();
com.google.protobuf.ByteString getArtifactIdBytes();
String getVersion();
}
I feel like if classes have new lines after their declaration, then interfaces and enums should follow the same pattern as well. An option to choose if newlines are added would be appreciated as well.
I'm not sure if this is a bug or an intended feature, however, I'm creating this issue to discuss this inconsistency in prettier.
- Lenguaje dominante
- Java
- Estrellas
- 1.2k
- Forks
- 122
- Merge medio
- 2 d 13 h
- PR fusionados (30 d)
- 32
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la 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 jhipster/prettier-java
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
jhipster/prettier-java#1113 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
jhipster/prettier-java#1115 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 56/100
jhipster/prettier-java#1114 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 66/100
jhipster/prettier-java#1112 ·
Los mantenedores suelen responder en 2 días
-
Comment "// @formatter:off" was not printedPosiblemente ocupada @jtkiesel la tomó hace 1 día. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
jhipster/prettier-java#1098 ·
Los mantenedores suelen responder en 2 días
Todos los issues de jhipster/prettier-java
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
QuiltMC/update-quilt-meta#28 ·
-
awaiting triage Documentation P3
Dificultad 1/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día
-
area/build area/maintainability component/camunda-process-test kind/tech-debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Kafka: Filter empty strings and whitespace in IcebergSinkConfig stringToListPosiblemente ocupada @mohamed-elbrik la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
area/kotlin
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día