Skip to contents

Check that while (TRUE) is not used for infinite loops.

Usage

repeat_linter()

See also

linters for a complete list of linters available in lintr.

Examples

# will produce lints
lint(
  text = "while (TRUE) { }",
  linters = repeat_linter()
)
#> ::warning file=<text>,line=1,col=1::file=<text>,line=1,col=1,[repeat_linter] Use 'repeat' instead of 'while (TRUE)' for infinite loops.


# okay
lint(
  text = "repeat { }",
  linters = repeat_linter()
)