# will produce lints
lint(
text = 'paste("a", "b", sep = "")',
linters = paste_linter()
)
lint(
text = 'paste(c("a", "b"), collapse = ", ")',
linters = paste_linter()
)
lint(
text = 'paste0(c("a", "b"), sep = " ")',
linters = paste_linter()
)
lint(
text = 'paste0(rep("*", 10L), collapse = "")',
linters = paste_linter()
)
lint(
text = 'paste0("http://site.com/", path)',
linters = paste_linter(allow_file_path = "never")
)
# okay
lint(
text = 'paste0("a", "b")',
linters = paste_linter()
)
lint(
text = 'paste("a", "b", sep = "")',
linters = paste_linter(allow_empty_sep = TRUE)
)
lint(
text = 'toString(c("a", "b"))',
linters = paste_linter()
)
lint(
text = 'paste(c("a", "b"), collapse = ", ")',
linters = paste_linter(allow_to_string = TRUE)
)
lint(
text = 'paste(c("a", "b"))',
linters = paste_linter()
)
lint(
text = 'strrep("*", 10L)',
linters = paste_linter()
)
lint(
text = 'paste0(year, "/", month, "/", day)',
linters = paste_linter(allow_file_path = "always")
)
lint(
text = 'paste0("http://site.com/", path)',
linters = paste_linter()
)
Run the code above in your browser using DataLab