-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cue/format/printer: fix indentation for clauses #1704
Conversation
PTAL😀 /cc @myitcv |
I'll defer to @rogpeppe here :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about adding a check in writeWhitespace
to never allow starting a file with a whitespace character? that seems to never make sense.
an alternative is why allowed
begins with blank
being set when printing the first token; it seems like we should start with just ignore
, the zero value.
That makes more sense, thanks for the review, I'll fix it as suggested. |
This PR reset the allow for blanks at the position 0. Fixes cue-lang#1544 Signed-off-by: Fog Dong <[email protected]>
PTAL 😄 /cc @mvdan |
@Lyoness and myself are reviewing this together :) give us a couple of days if that's okay. |
I had a hunch that we could instead investigate why What do you think, @FogDong? |
LGTM, you guys know cue better than me after all. @mvdan Still, I think it's better for the community if we can have some more discussion before another PR. Although it took some time to investigate this issue and made my first PR, it's time to close it. |
Certainly - and the last thing I want to do is to discourage further contributions :) I did try to nudge the discussion in another direction in an earlier comment:
However, it was hard for me to say whether that idea would turn out to be a good fix without trying it. It's far from ideal if I ask you to implement a solution without me knowing ahead of time whether it will work or not - I'm new to the So I thought it would be best to just try and see what happens. I'm still not sure whether Paul or Marcel will say that the second solution is better - if not, perhaps we'll come back here. |
Signed-off-by: Fog Dong [email protected]
This PR reset the allow for clauses at the position 0.
Fixes #1544