Check that while (TRUE) is not used for infinite loops. While this is valid
R code, using repeat {} is more explicit.
See also
linters for a complete list of linters available in lintr.
Examples
# will produce lints
lint(
text = "while (TRUE) { }",
linters = repeat_linter()
)
#> <text>:1:1: style: [repeat_linter] Use 'repeat' instead of 'while (TRUE)' for infinite loops.
#> while (TRUE) { }
#> ^~~~~~~~~~~~~~~~
# okay
lint(
text = "repeat { }",
linters = repeat_linter()
)
#> ℹ No lints found.
