You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After @aljazerzen built the foundations of this, I have filled a few gaps, and now all the examples format into correct PRQL. But we still have a few gaps in getting to something we can use everywhere.
In order to roll this out fully, it's quite important to be close to 100%, since all PRQL will be formatted this way — in the book, whenever someone saves a file in VS Code, whenever someone runs pre-commit (both in our repo and others'), etc. Without being close to 100%, it's not that instrumentally useful.
We currently remove comments!
Do we want to elide parentheses around function calls in {x = (sum foo)} (from feat: Format UnOp correctly #2803 (comment)). This in the docs here. It might require understanding the grandparent node (need to think more)
Do we want from t=tracks or from t = tracks? I marginally preferred the former — given that we have fairly few separators, having tighter expressions groups things better. (but this is not a strong view, maybe +0.3, and only aesthetics) style: Use foo=bar style in codegen #2779
Do we want to break inner transforms at all? e.g. this is a lot on one line. But I think my reaction is mostly based on what I'm used to, and I don't think there would be a good rule that lets us handle inner transforms differently. Though we could linebreak earlier (e.g. line break at 40)
What's up?
After @aljazerzen built the foundations of this, I have filled a few gaps, and now all the examples format into correct PRQL. But we still have a few gaps in getting to something we can use everywhere.
In order to roll this out fully, it's quite important to be close to 100%, since all PRQL will be formatted this way — in the book, whenever someone saves a file in VS Code, whenever someone runs
pre-commit(both in our repo and others'), etc. Without being close to 100%, it's not that instrumentally useful.{x = (sum foo)}(from feat: FormatUnOpcorrectly #2803 (comment)). This in the docs here. It might require understanding the grandparent node (need to think more)modulebreaks, which breaks the standard library (though I actually thought we were only going to do files as modules @aljazerzen ?) feat: codegen for module, type and annotations #2949from t=tracksorfrom t = tracks? I marginally preferred the former — given that we have fairly few separators, having tighter expressions groups things better. (but this is not a strong view, maybe +0.3, and only aesthetics) style: Usefoo=barstyle in codegen #2779prql/prql-compiler/tests/integration/snapshots/integration__fmt@distinct_on.prql.snap
Line 8 in 31c3e71
{(-foo)}has extra parentheses, :prql/prql-compiler/tests/integration/snapshots/integration__fmt@distinct_on.prql.snap
Lines 8 to 9 in 31c3e71
UnOpcorrectly #2803