# will produce lints
lint(
text = "if (x <- 1L) TRUE",
linters = implicit_assignment_linter()
)
lint(
text = "mean(x <- 1:4)",
linters = implicit_assignment_linter()
)
# okay
writeLines("x <- 1L\nif (x) TRUE")
lint(
text = "x <- 1L\nif (x) TRUE",
linters = implicit_assignment_linter()
)
writeLines("x <- 1:4\nmean(x)")
lint(
text = "x <- 1:4\nmean(x)",
linters = implicit_assignment_linter()
)
Run the code above in your browser using DataLab