# will produce lints
lint(
text = "# x <- 1",
linters = commented_code_linter()
)
lint(
text = "x <- f() # g()",
linters = commented_code_linter()
)
lint(
text = "x + y # + z[1, 2]",
linters = commented_code_linter()
)
# okay
lint(
text = "x <- 1; x <- f(); x + y",
linters = commented_code_linter()
)
lint(
text = "#' x <- 1",
linters = commented_code_linter()
)
Run the code above in your browser using DataLab