Printer: no brace placement option, and moved code loses literal spelling, spacing and comment positions
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 38/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- developer-experience, tooling
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Java
- Stelle
- 1
- Fork
- 1
- Merge medio
- 1h 58m
- PR unite (30g)
- 5
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di CodeLaser/maddi
-
build/ci good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
bug front-end:javac
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
-
C# printer: an inner class of a generic class needs the outer type's arguments (Outer<A>.Inner)Apertafront-end:csharp
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 10/100
-
Java → C# translation: an idiomatic C# printer driven by the modification and nullability analysesApertaenhancement extension front-end:csharp
Difficoltà 5/5 Più di una settimana Idoneità per principianti 8/100
Tutte le issue di CodeLaser/maddi
Issue simili
-
enhancement Improvement
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
zowe/zowe-client-java-sdk#647 ·
-
NullPointerException when a `DeserializationProblemHandler` returns `null` for `byte[]` (single value unwrapped) and `char[]` elementsForse già presa @Marti2203 l’ha presa oggi. Aperta
Difficoltà 2/5 Mezza giornata Idoneità per principianti 88/100
FasterXML/jackson-databind#6300 ·
I maintainer di solito rispondono entro 1 giorno
-
content good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
cpinitiative/usaco-guide#6699 ·
I maintainer di solito rispondono entro 1 giorno
-
BC remittance upload: a claim MSP refused (S03) is saved with a blank status instead of refused (F)Forse già presa Una pull request collegata a questa issue è aperta o già unita. Apertatype: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
carlos-emr/carlos#4933 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
apache/rocketmq-dashboard#6925 ·
I maintainer di solito rispondono entro 3 giorni