-
Notifications
You must be signed in to change notification settings - Fork 5
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
disallow end)
#35
Comments
Do you have a specific example where Runic outputs |
I would only ever write this as
or
although realistically I probably won't put I'm well aware that the rewriting I propose looks kinda ugly as well & verbose in the number of lines --- but I think that is intentionally a good thing. if the formatter does not rewrite my code in a way that looks nice that's probably a signal that I need to break up some of the logic anyway (because |
I see, for some reason I thought you only disliked The current reason Runic doesn't change anything with your sum(filter(rand(10000)) do x
2 * x
end) which would then be formatted as sum(
filter(rand(10000)) do x
2 * x
end,
) by already existing rules. |
that would definitely work for me although I don't know how controversial my opinion is on this preference --- possibly many people don't mind (or even prefer) single line with |
This patch introduces formatting for all blocklike constructs (`if`/`try`/`function`/`begin`/`for`/`while`/...) such that inner block always start and end with a newline character. For example, ```julia if x print("x") else print("y") end ``` will be reformatted as ```julia if x print("x") else print("y") end ``` An exception is (currently) made for comments, for example ```julia if x # comment print("x") end ``` will *not* be formatted as ```julia if x # comment print("x") end ``` even though the comment is technically inside the block. Closes #35.
With #46 sum(filter(rand(10000)) do x 2 * x end) becomes sum(
filter(rand(10000)) do x
2 * x
end,
) |
This patch introduces formatting for all blocklike constructs (`if`/`try`/`function`/`begin`/`for`/`while`/...) such that inner block always start and end with a newline character. For example, ```julia if x print("x") else print("y") end ``` will be reformatted as ```julia if x print("x") else print("y") end ``` An exception is (currently) made for comments, for example ```julia if x # comment print("x") end ``` will *not* be formatted as ```julia if x # comment print("x") end ``` even though the comment is technically inside the block. Closes #35.
This patch introduces formatting for all blocklike constructs (`if`/`try`/`function`/`begin`/`for`/`while`/...) such that inner block always start and end with a newline character. For example, ```julia if x print("x") else print("y") end ``` will be reformatted as ```julia if x print("x") else print("y") end ``` An exception is (currently) made for comments, for example ```julia if x # comment print("x") end ``` will *not* be formatted as ```julia if x # comment print("x") end ``` even though the comment is technically inside the block. Closes #35.
This patch introduces formatting for all blocklike constructs (`if`/`try`/`function`/`begin`/`for`/`while`/...) such that inner block always start and end with a newline character. For example, ```julia if x print("x") else print("y") end ``` will be reformatted as ```julia if x print("x") else print("y") end ``` An exception is (currently) made for comments, for example ```julia if x # comment print("x") end ``` will *not* be formatted as ```julia if x # comment print("x") end ``` even though the comment is technically inside the block. Closes #35.
I feel very strongly that
end)
should never appear in my code, and similarly(keyword
. I understand that opinions may differ, but for my part I would never use a formatter that declines to reformat all appearance of these bigramsThe text was updated successfully, but these errors were encountered: