# will produce lints
lint(
text = "x <- c()",
linters = unnecessary_concatenation_linter()
)
lint(
text = "x <- c(TRUE)",
linters = unnecessary_concatenation_linter()
)
lint(
text = "x <- c(1.5 + 2.5)",
linters = unnecessary_concatenation_linter(allow_single_expression = FALSE)
)
# okay
lint(
text = "x <- NULL",
linters = unnecessary_concatenation_linter()
)
# In case the intent here was to seed a vector of known size
lint(
text = "x <- integer(4L)",
linters = unnecessary_concatenation_linter()
)
lint(
text = "x <- TRUE",
linters = unnecessary_concatenation_linter()
)
lint(
text = "x <- c(1.5 + 2.5)",
linters = unnecessary_concatenation_linter(allow_single_expression = TRUE)
)
Run the code above in your browser using DataLab