| pipe_consistency_linter {lintr} | R Documentation |
Pipe consistency linter
Description
Check that the recommended pipe operator is used, or more conservatively that pipes are consistent by file.
Usage
pipe_consistency_linter(pipe = c("|>", "%>%", "auto"))
Arguments
pipe |
Which pipe operator is valid (either |
Tags
configurable, default, readability, style
See Also
-
linters for a complete list of linters available in lintr.
Examples
# 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("%>%")
)
[Package lintr version 3.3.0-1 Index]