Trailing comma in AST
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia leggendo come Prism gestisce ArrayNode e HashNode e come rubyfmt consuma l’AST di Prism. Verifica se la presenza di una virgola finale può essere rappresentata per questi nodi senza modificare il comportamento di formattazione esistente. Il lavoro è completato quando viene documentata una raccomandazione concreta sul fatto che Prism debba tenere traccia di questa informazione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
For background, Stripe uses rubyfmt to format Ruby. One thing rubyfmt doesn't have today is trailing commas: all trailing commas are stripped by formatting, which is the preference of the maintainers of that project.
For a while I've wished for something like "rubyfmt + trailing commas." Before it even makes sense to have the conversation about whether to make that change, I was thinking through what it would even look like in practice. One thing which would make things easier to adopt would be if rubyfmt could run in a mode that preserves trailing commas, rather than universally adding or removing them (you could migrate slices of a codebase at a time, instead of having to land a PR touching hundreds of thousands of files all at once).
rubyfmt now uses prism for parsing Ruby files, and prism omits information about whether various constructs had trailing commas.
I was curious to get a temperature check on whether this is something that prism would ever want to see tracked. For example, in ArrayNode or in HashNode, to have some way to know that the user had written a trailing comma.
This is a very "what if" sort of line of thought, so please don't feel rushed to answer, and also I completely understand if the answer is definitively "that's not something prism is open to incorporating."
- Lingua principale
- C
- Stelle
- 1k
- Fork
- 194
- Merge medio
- 2g 6h
- PR unite (30g)
- 15
Guida per i contributori
Apri 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 ruby/prism
-
Revisit comments Apertaenhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
-
java
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
Release official Java API Apertajava
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
java
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
bradcypert/plum#53 ·
-
Component: GLib
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Status: Opened
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
nextbsd/nextbsd-userland#285 ·