# will produce lints
lint(
text = "my_var <- 1L",
linters = object_name_linter(styles = "CamelCase")
)
lint(
text = "xYz <- 1L",
linters = object_name_linter(styles = c("UPPERCASE", "lowercase"))
)
lint(
text = "MyVar <- 1L",
linters = object_name_linter(styles = "dotted.case")
)
lint(
text = "asd <- 1L",
linters = object_name_linter(regexes = c(my_style = "F$", "f$"))
)
# okay
lint(
text = "my_var <- 1L",
linters = object_name_linter(styles = "snake_case")
)
lint(
text = "xyz <- 1L",
linters = object_name_linter(styles = "lowercase")
)
lint(
text = "my.var <- 1L; myvar <- 2L",
linters = object_name_linter(styles = c("dotted.case", "lowercase"))
)
lint(
text = "asdf <- 1L; asdF <- 1L",
linters = object_name_linter(regexes = c(my_style = "F$", "f$"))
)
Run the code above in your browser using DataLab