-
Notifications
You must be signed in to change notification settings - Fork 2
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
Single line tuples #7
Conversation
tests/test_writer.py
Outdated
) == ( | ||
"""{ | ||
a = 1; | ||
b = (2,3); |
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.
I'd have expected to find a space after the comma. But I guess that's what Glyphs does to shave off one byte? Ugh.
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.
Kind of makes sense when this is on every node in a file. Separate issue, but Glyphs also writes empty dictionaries without newlines, so that's another thing...
E {
E pos = 700;
E },
E {
E pos = 500;
E },
E - {
E - },
E + {},
E ? +
E {
E pos = -200;
E }
E );
At some point I think we just need to give up and aim for "something Glyphs can read without errors" rather than "100% whitespace-compatible round-tripping".
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.
something Glyphs can read without errors
wait, are you saying that Glyphs trips up with an error when reading a tuple that has spaces after the comma, or an empty dict that is not inlined? that'd be weird.
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.
No, I'm saying it doesn't. While it's nice to aim for 100% whitespace compatibility, it's not necessary. I guess what I'm saying is when we test round-tripping in glyphsLib test suites we could be more relaxed about whitespace differences.
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.
when we test round-tripping in glyphsLib test suites we could be more relaxed about whitespace differences.
i agree
But in that case, I would care less about 100% whitespace compatibility and more about getting an output that matches reasonable user's expectations, like having a space after the comma in a single-line tuple.
Codecov Report
@@ Coverage Diff @@
## master #7 +/- ##
=========================================
Coverage ? 93.19%
=========================================
Files ? 5
Lines ? 838
Branches ? 6
=========================================
Hits ? 781
Misses ? 57
Partials ? 0
Continue to review full report at Codecov.
|
Co-authored-by: Cosimo Lupo <cosimo@anthrotype.com>
Fixes #6