-
Notifications
You must be signed in to change notification settings - Fork 184
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
Unify bracing-related linters / parentheses / if-else clauses? #1041
Comments
Conceptuall, I can see linters related to the style of function definitions and linters related to flow control statements. The A
Alternatively, we could unify to two linters 1. NB that since many of these linters are default in 2.0.1, custom linter configs with, e.g. What are your thoughts? |
great point.
indeed. and this is a generally useful test, too, not just for deprecations.
IMO the UX is not great here -- I read those and only get a vague sense of what it's for. |
Filed #1049 for the NULL check |
Copying comment from the dup'd issue:
|
@MichaelChirico I've completed a PR chain to do this, but left out LMK what you think.
lintr::lint(
text = "a <- function() { \n}",
linters = list(
trailing_whitespace_linter(),
open_curly_linter()
)
)
#> <text>:1:17: style: Opening curly braces should never go on their own line and should always be followed by a new line.
#> a <- function() {
#> ^
#> <text>:1:18: style: Trailing whitespace is superfluous.
#> a <- function() {
#> ^~
Once the merging is complete, adding a |
Sorry, just saw the comment here.
SGTM. Do we want a |
We currently have a variegated list of linters related to bracing and parentheses:
closed_curly_linter()
else_same_line_linter()
function_brace_linter()
function_left_parentheses_linter()
if_else_match_braces_linter()
open_curly_linter()
paren_body_linter()
paren_brace_linter()
spaces_inside_linter()
spaces_left_parentheses_linter()
Should we consolidate any of these?
The text was updated successfully, but these errors were encountered: