View source: R/pipe_consistency_linter.R
pipe_consistency_linter | R Documentation |
Check that the recommended pipe operator is used, or more conservatively that pipes are consistent by file.
pipe_consistency_linter(pipe = c("|>", "%>%", "auto"))
pipe |
Which pipe operator is valid (either |
configurable, default, 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("%>%")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.