repeat_linter: Repeat linter

View source: R/repeat_linter.R

repeat_linterR Documentation

Repeat linter

Description

Check that ⁠while (TRUE)⁠ is not used for infinite loops. While this is valid R code, using repeat {} is more explicit.

Usage

repeat_linter()

Tags

readability, style

See Also

linters for a complete list of linters available in lintr.

Examples

# will produce lints
lint(
  text = "while (TRUE) { }",
  linters = repeat_linter()
)


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


lintr documentation built on Nov. 27, 2025, 9:06 a.m.