Check that the desired quote delimiter is used for string constants.
quotes_linter(delimiter = c("\"", "'"))
Which quote delimiter to accept. Defaults to the tidyverse
default of "
(double-quoted strings).
configurable, consistency, default, readability, style
linters for a complete list of linters available in lintr.
# will produce lints
lint(
text = "c('a', 'b')",
linters = quotes_linter()
)
# okay
lint(
text = 'c("a", "b")',
linters = quotes_linter()
)
code_lines <- "paste0(x, '\"this is fine\"')"
writeLines(code_lines)
lint(
text = code_lines,
linters = quotes_linter()
)
# okay
lint(
text = "c('a', 'b')",
linters = quotes_linter(delimiter = "'")
)
Run the code above in your browser using DataLab