# When using interactively you will usually pass the result onto `lint` or `lint_package()`
f <- withr::local_tempfile(lines = "my_slightly_long_variable_name <- 2.3", fileext = "R")
lint(f, linters = linters_with_defaults(line_length_linter = line_length_linter(120)))
# the default linter list with a different line length cutoff
my_linters <- linters_with_defaults(line_length_linter = line_length_linter(120))
# omit the argument name if you are just using different arguments
my_linters <- linters_with_defaults(defaults = my_linters, object_name_linter("camelCase"))
# remove assignment checks (with NULL), add absolute path checks
my_linters <- linters_with_defaults(
defaults = my_linters,
assignment_linter = NULL,
absolute_path_linter()
)
# checking the included linters
names(my_linters)
Run the code above in your browser using DataLab