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
The curly braces linter wants a newline after an opening curly brace, not accepting comments there.
Example
if ("P"!="NP") { # what most people expect
print("Cryptomania is possible")
} else { # what would make a lot of people sad
print("we live in Algorithmica")
}
lintr output:
R\test.R:7:22: style: Opening curly braces should never go on their own line and should always be followed by a new line.
if ("P" != "NP") { # what most people expect
^
R\test.R:9:12: style: Opening curly braces should never go on their own line and should always be followed by a new line.
} else { # what would make a lot of people sad
Reacted by Alex Chubaty, Florian Privé, Marie-Helene Burle and Ben Torvaney
I second @wamserma (almost posted a duplicate to this by accident actually 😛 ).
In the meantime, I am using
if ("P" != "NP") {
# what most people expect
print("Cryptomania is possible")
} else {
# what would make a lot of people sad
print("we live in Algorithmica")
}
Activity
fangly commentedon Jan 27, 2017
Another case where
open_curly_linter()fails, in my opinion, is with standalone code blocks (without leading if/for/while/repeat):mhburle commentedon Apr 1, 2018
I second @wamserma (almost posted a duplicate to this by accident actually 😛 ).
In the meantime, I am using
and maybe it makes it more readable???