It might be useful to disable only a specific linter on a per-line basis, e.g.
`%||%` = function(x, y) {
if (is.null(x)) y else x
}
produces two default lints: object_name_linter and assignment_linter.
One may actively decide that %||% is an acceptable name here and not want to generally disable object_name_linter.
Currently, this can only be achieved by # nolint'ing the entire line
`%||%` = function(x, y) { # nolint
if (is.null(x)) y else x
}
but unfortunately this also kills the assignment_linter
It would be very useful to have a way to only exclude some linters on a line (or in a block).
A syntax might be a space-separated list of linters to be disabled, e.g.
`%||%` = function(x, y) { # nolint object_name_linter
if (is.null(x)) y else x
}
I realize this would require work in the way exclusions are specified. Especially the line-based specification in .lintr files or the exclusions argument requires thought.
One solution would be one more level of (optional) nesting
exclude: list(
"my_file.R" = list(
1,
"2" = "object_name_linter",
"4" = c("line_length_linter", "commented_code_linter")
)
)
It might be useful to disable only a specific linter on a per-line basis, e.g.
produces two default lints:
object_name_linterandassignment_linter.One may actively decide that
%||%is an acceptable name here and not want to generally disableobject_name_linter.Currently, this can only be achieved by # nolint'ing the entire line
but unfortunately this also kills the
assignment_linterIt would be very useful to have a way to only exclude some linters on a line (or in a block).
A syntax might be a space-separated list of linters to be disabled, e.g.
I realize this would require work in the way exclusions are specified. Especially the line-based specification in
.lintrfiles or theexclusionsargument requires thought.One solution would be one more level of (optional) nesting