todo_comment_linter: TODO comment linter

View source: R/comment_linters.R

todo_comment_linterR Documentation

TODO comment linter

Description

Check that the source contains no TODO comments (case-insensitive).

Usage

todo_comment_linter(todo = c("todo", "fixme"))

Arguments

todo

Vector of strings that identify TODO comments.

Tags

configurable, style

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()
)

lint(
  text = "pi <- 1.0 # FIXME",
  linters = todo_comment_linter()
)

lint(
  text = "x <- TRUE # hack",
  linters = todo_comment_linter(todo = c("todo", "fixme", "hack"))
)

# 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()
)


lintr documentation built on Nov. 7, 2023, 5:07 p.m.