# will produce lints
lint(
text = "x[grep(pattern, x)]",
linters = regex_subset_linter()
)
lint(
text = "x[stringr::str_which(x, pattern)]",
linters = regex_subset_linter()
)
# okay
lint(
text = "grep(pattern, x, value = TRUE)",
linters = regex_subset_linter()
)
lint(
text = "stringr::str_subset(x, pattern)",
linters = regex_subset_linter()
)
Run the code above in your browser using DataLab