Printer: no brace placement option, and moved code loses literal spelling, spacing and comment positions
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Área
- developer-experience, tooling
Línea de trabajo
Start from FormattingOptions and the printer that re-renders members after a move. Confirm there is no brace-placement setting and that alwaysBreakPriorityBlocks is not Allman. Trace how literals, comments, spacing, braceless ifs, javadoc, and the blank line after imports are taken from the AST versus source. Done when a brace-placement option exists and moved code keeps source spelling and comment positions so an Allman project would accept the diff.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Observed while refactoring Apache Cassandra (an Allman-style codebase) in September 2026: every member a refactoring moves is re-rendered through maddi's printer, and the output cannot follow the project's brace style, and changes code it should carry unchanged.
Brace placement. FormattingOptions has no brace-placement option. alwaysBreakPriorityBlocks breaks the line after {, which is not the same as putting the brace on its own line (Allman). A consumer that has inferred the project's style (bracesEndOfLine=false) has nothing to map it to, so moved code always comes out K&R.
Fidelity defects seen in the same output:
- spacing:
if ( !datum.endsWith(unit)), and a cast printed as(Class<T> ) - a braceless one-statement
ifbody gains braces and is collapsed onto one line:if (...) { throw ...; } - a line comment between a condition and its
{moves to the other side of the brace - javadoc lines are joined without a space ("the methods above.Understands both")
- the blank line after the imports is lost
- integer literals lose their source spelling:
0xFFFFis printed as65535,50_000as50000
Expected: a brace-placement option in FormattingOptions, and literals and comments carried from source. Code a tool moves should read as if the project's authors wrote it; a diff that restyles moved code won't be accepted upstream.
- Lenguaje dominante
- Java
- Estrellas
- 1
- Forks
- 1
- Merge medio
- 1 h 55 min
- PR fusionados (30 d)
- 8
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 CodeLaser/maddi
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
CodeLaser/maddi#166 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
build/ci good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Java printer: a nested type prints by simple name when the unit imports another type of that nameAbiertobug
Dificultad 3/5 1-2 días Aptitud para principiantes 57/100
Los mantenedores suelen responder en 1 día
Todos los issues de CodeLaser/maddi
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
quarkiverse/quarkus-google-cloud-services#1188 ·
Los mantenedores suelen responder en 1 día
-
Component: Frontend Component: Web Component Type: Maintenance
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
it-at-m/refarch-templates#1944 ·
Los mantenedores suelen responder en 2 días
-
priority: p2 type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
googleapis/java-genai#1372 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 60/100
-
GeoSeries scale and skew tests fail with pytest 9.2.0Posiblemente ocupada @jiayuasu la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día