-
Notifications
You must be signed in to change notification settings - Fork 446
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
chore: use string gaps more consistently #4918
Conversation
@tydeu There are some large string literals in lake that don't look great with string gaps. Want me to revert? |
@kmill Yeah, I don't think string gaps work well stylistically for strings that are meant to be multiple lines. I think those need indented heredocs or a related form of multiline string literal, |
@tydeu Perhaps you don't like how they look (which is understandable, they're ugly), but I was using our version of multiline string literal notation. Each new line starts with
That's fine if you don't want to use it in Lake, and I reverted it, though I added string gaps to eliminate newlines in paragraphs — you weren't flowing the help text to a particular number of columns, right? |
Mathlib CI status (docs):
|
Yes, the help text was wrapped at 80 characters. Unfortunately, some terminals like to scroll rather than flow text, so relying on the terminal wrapping is unreliable. |
@tydeu I've removed all the changes to Lake. (One reason I was asking is that when I spot checked, I found some could be rewrapped.) |
I'm not sure what to think about these changes, I can't say they increase readability |
One oddity I noticed is that there appears to be a mix of lines starting with |
@Kha My motivation here is primarily to be able to properly indent everything and make it indentation-independent. There are also some places that remove some unintended newlines, though only in attribute descriptions if I remember correctly. I think that if there's any harm to readability of the string contents, it's made up for by making program structure clearer. @tydeu The idea of starting lines with I don't want to prematurely choose a particular style, other than agreeing that it's better avoiding strings contents spilling into column 1 (except for perhaps strings that are global constants, like the ones in Lake). I agree that it looks better having |
A indention-sensitive heredoc (
becomes
That is, is strips the initial indentation from each line. Thus it addresses the primary use case you mentioned. Furthermore, instead of using the heredoc delimiters, we could use a simpler delimiter like
Admittedly, yes. However, I think the |
Found all missing string gaps by compiling Lean with a modified parser that rejects newlines within strings. Made changes almost everywhere but in cases where the strings were embedded documents (like some Javascript, or the multiline strings throughout Lake).