pipe_consistency_linter {lintr} | R Documentation |
Check that pipe operators are used consistently by file, or optionally specify one valid pipe operator.
pipe_consistency_linter(pipe = c("auto", "%>%", "|>"))
pipe |
Which pipe operator is valid (either |
configurable, readability, style
linters for a complete list of linters available in lintr.
# will produce lints
lint(
text = "1:3 |> mean() %>% as.character()",
linters = pipe_consistency_linter()
)
lint(
text = "1:3 %>% mean() %>% as.character()",
linters = pipe_consistency_linter("|>")
)
# okay
lint(
text = "1:3 %>% mean() %>% as.character()",
linters = pipe_consistency_linter()
)
lint(
text = "1:3 |> mean() |> as.character()",
linters = pipe_consistency_linter()
)