# will produce lints
lint(
text = "for (x in x) { TRUE }",
linters = for_loop_index_linter()
)
lint(
text = "for (x in foo(x, y)) { TRUE }",
linters = for_loop_index_linter()
)
# okay
lint(
text = "for (xi in x) { TRUE }",
linters = for_loop_index_linter()
)
lint(
text = "for (col in DF$col) { TRUE }",
linters = for_loop_index_linter()
)
Run the code above in your browser using DataLab