r-lib / lintr

Static Code Analysis for R
https://lintr.r-lib.org
Other
1.2k stars 187 forks source link

lint missing argument name #2626

Open TanguyBarthelemy opened 4 months ago

TanguyBarthelemy commented 4 months ago

Related to #2562

Is it possible to add a new lintr to ensure that function calls have no missing or default arguments?

For example, the following code will be marked by {lintr}:

f <- function(x, y) return(x + y)
g <- function(x) return(f(1, x))

and the suggested correction would be:

f <- function(x, y) return(x + y)
g <- function(x) return(f(x = 1, y = x))

Maybe this kind of lintr already exists.

MichaelChirico commented 4 months ago

Related: #2627