# will produce lints
lint(
text = "x <- 1.2 ",
linters = trailing_whitespace_linter()
)
code_lines <- "a <- TRUE\n \nb <- FALSE"
writeLines(code_lines)
lint(
text = code_lines,
linters = trailing_whitespace_linter()
)
# okay
lint(
text = "x <- 1.2",
linters = trailing_whitespace_linter()
)
lint(
text = "x <- 1.2 # comment about this assignment",
linters = trailing_whitespace_linter()
)
code_lines <- "a <- TRUE\n \nb <- FALSE"
writeLines(code_lines)
lint(
text = code_lines,
linters = trailing_whitespace_linter(allow_empty_lines = TRUE)
)
Run the code above in your browser using DataLab