Check that the source contains no TODO comments (case-insensitive).
Usage
todo_comment_linter(todo = c("todo", "fixme"))
See also
linters for a complete list of linters available in lintr.
Examples
# will produce lints
lint(
text = "x + y # TODO",
linters = todo_comment_linter()
)
#> ::warning file=<text>,line=1,col=7::file=<text>,line=1,col=7,[todo_comment_linter] TODO comments should be removed.
lint(
text = "pi <- 1.0 # FIXME",
linters = todo_comment_linter()
)
#> ::warning file=<text>,line=1,col=11::file=<text>,line=1,col=11,[todo_comment_linter] TODO comments should be removed.
lint(
text = "x <- TRUE # hack",
linters = todo_comment_linter(todo = c("todo", "fixme", "hack"))
)
#> ::warning file=<text>,line=1,col=11::file=<text>,line=1,col=11,[todo_comment_linter] TODO comments should be removed.
# okay
lint(
text = "x + y # my informative comment",
linters = todo_comment_linter()
)
lint(
text = "pi <- 3.14",
linters = todo_comment_linter()
)
lint(
text = "x <- TRUE",
linters = todo_comment_linter()
)