# will produce lints
lint(
text = "function(y = 1, z = 2, x) {}",
linters = function_argument_linter()
)
lint(
text = "function(x, y, z = 1, ..., w) {}",
linters = function_argument_linter()
)
# okay
lint(
text = "function(x, y = 1, z = 2) {}",
linters = function_argument_linter()
)
lint(
text = "function(x, y, w, z = 1, ...) {}",
linters = function_argument_linter()
)
lint(
text = "function(y = 1, z = 2, x = NULL) {}",
linters = function_argument_linter()
)
lint(
text = "function(x, y, z = 1, ..., w = NULL) {}",
linters = function_argument_linter()
)
Run the code above in your browser using DataLab