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
which I feel is nicely spaced. However, lintr says
Place a space before left parenthesis, except in a function call.
So when I do this,
x^ (y + z)
the lintr message disappears, but a subsequent "Format Document With ... - R LSP Client" in VS Code will remove the space and I end up with the first line and its lintr message. (The same is true for x ^ (y + z).)
Place a space before left parentheses, except in a function call.
and
Place spaces around all infix operators
(emphasis mine) and has an y ^ x example in the code. So it's hard to argue that lintr is wrong.
At the same time, styler follows the tidyverse style guide (source), which does not require spaces around all parentheses and has an exception for certain infix operators, including ^:
There are a few exceptions, which should never be surrounded by spaces:
The operators with high precedence: ::, :::, $, @, [, [[, ^, unary -, unary +, and :.
The text was updated successfully, but these errors were encountered:
Note that I am using https://github.com/REditorSupport/vscode-r-lsp, but I feel that particular implementation is not the core issue, so I'll try here first.
My problem is this line:
which I feel is nicely spaced. However,
lintr
saysSo when I do this,
the
lintr
message disappears, but a subsequent "Format Document With ... - R LSP Client" in VS Code will remove the space and I end up with the first line and itslintr
message. (The same is true forx ^ (y + z)
.)I guess the problem is that
lintr
follows Hadley Wickham's style guide (source), which statesand
(emphasis mine) and has an
y ^ x
example in the code. So it's hard to argue thatlintr
is wrong.At the same time,
styler
follows thetidyverse
style guide (source), which does not require spaces around all parentheses and has an exception for certain infix operators, including^
:The text was updated successfully, but these errors were encountered: