# will produce lints
lint(
text = "x<-1L",
linters = infix_spaces_linter()
)
lint(
text = "1:4 %>%sum()",
linters = infix_spaces_linter()
)
# okay
lint(
text = "x <- 1L",
linters = infix_spaces_linter()
)
lint(
text = "1:4 %>% sum()",
linters = infix_spaces_linter()
)
code_lines <- "
ab <- 1L
abcdef <- 2L
"
writeLines(code_lines)
lint(
text = code_lines,
linters = infix_spaces_linter(allow_multiple_spaces = TRUE)
)
lint(
text = "a||b",
linters = infix_spaces_linter(exclude_operators = "||")
)
lint(
text = "sum(1:10, na.rm=TRUE)",
linters = infix_spaces_linter(exclude_operators = "EQ_SUB")
)
Run the code above in your browser using DataLab