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
{{ message }}
Repository navigation
Linter for space needed after right parenthesis of function symbol formals #809
The following linters might be related to this issue, but they are quite unique on their own.
$ <text>:List of 8
..$ filename : chr "<text>"
..$ line_number : int 1
..$ column_number: int 15
..$ type : chr "style"
..$ message : chr "Remove spaces before the left parenthesis in a function call."
..$ line : Named chr "f <- function (x){x + 1}"
.. ..- attr(*, "names")= chr "1"
..$ ranges : NULL
..$ linter : chr "function_left_parentheses_linter"
..- attr(*, "class")= chr "lint"
$ <text>:List of 8
..$ filename : chr "<text>"
..$ line_number : int 1
..$ column_number: int 18
..$ type : chr "style"
..$ message : chr "Opening curly braces should never go on their own line and should always be followed by a new line."
..$ line : Named chr "f <- function (x){x + 1}"
.. ..- attr(*, "names")= chr "1"
..$ ranges : NULL
..$ linter : chr "open_curly_linter"
..- attr(*, "class")= chr "lint"
$ <text>:List of 8
..$ filename : chr "<text>"
..$ line_number : int 1
..$ column_number: int 18
..$ type : chr "style"
..$ message : chr "There should be a space between right parenthesis and an opening curly brace."
..$ line : chr "f <- function (x){x + 1}"
..$ ranges :List of 1
.. ..$ : num [1:2] 18 18
..$ linter : chr "paren_brace_linter"
..- attr(*, "class")= chr "lint"
$ <text>:List of 8
..$ filename : chr "<text>"
..$ line_number : int 1
..$ column_number: int 24
..$ type : chr "style"
..$ message : chr "Closing curly-braces should always be on their own line, unless they are followed by an else."
..$ line : Named chr "f <- function (x){x + 1}"
.. ..- attr(*, "names")= chr "1"
..$ ranges : NULL
..$ linter : chr "closed_curly_linter"
..- attr(*, "class")= chr "lint"
Looks like it enhances the paren_brace_linter so that it not only requires that there be a space between the right parenthesis and an opening curly brace, but also requires a space between the right parenthesis and the function body if they are in the same line. It is more like a paren_space_linter then.
If we are not to enhancing existing linters in this way, then we will need a new linter to specifically check this.
Activity
kpagacz commentedon Jul 7, 2021
I don't know if there is any contribution guideline for lintr, therefore I am just going to ask - is it alright if I start working on this?
Do you think it should be a new linter or be a part of an already existing linter?
renkun-ken commentedon Jul 7, 2021
The following linters might be related to this issue, but they are quite unique on their own.
Looks like it enhances the
paren_brace_linterso that it not only requires that there be a space between the right parenthesis and an opening curly brace, but also requires a space between the right parenthesis and the function body if they are in the same line. It is more like aparen_space_linterthen.If we are not to enhancing existing linters in this way, then we will need a new linter to specifically check this.
kpagacz commentedon Jul 7, 2021
I have created a PR for this issue. Let me know what you think.
#830
feat(new linter): added a new linter (#830)