# will produce lints
code_lines <- "1:3 %>%\n mean() %>% as.character()"
writeLines(code_lines)
lint(
text = code_lines,
linters = pipe_continuation_linter()
)
code_lines <- "1:3 |> mean() |>\n as.character()"
writeLines(code_lines)
lint(
text = code_lines,
linters = pipe_continuation_linter()
)
# okay
lint(
text = "1:3 %>% mean() %>% as.character()",
linters = pipe_continuation_linter()
)
code_lines <- "1:3 %>%\n mean() %>%\n as.character()"
writeLines(code_lines)
lint(
text = code_lines,
linters = pipe_continuation_linter()
)
lint(
text = "1:3 |> mean() |> as.character()",
linters = pipe_continuation_linter()
)
code_lines <- "1:3 |>\n mean() |>\n as.character()"
writeLines(code_lines)
lint(
text = code_lines,
linters = pipe_continuation_linter()
)
Run the code above in your browser using DataLab