commented_code_linter {lintr} | R Documentation |
Commented code linter
Description
Check that there is no commented code outside roxygen blocks.
Usage
commented_code_linter()
Tags
best_practices, default, readability, style
See Also
linters for a complete list of linters available in lintr.
Examples
# 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()
)
[Package lintr version 3.1.2 Index]