Open m-muecke opened 2 weeks ago
I think deparse(substitute(x))
is error-prone, hence why deparse1()
is recommended... but I'm not sure there's no legitimate need for plain deparse(substitute(x))
, hence a lot of false positives like you say. I tend to shy away from linters that have a lot of built-in false positives, especially without a really good classification of good vs. bad use cases that we can convey concisely to the user in a lint message. Do you want to flesh something like that out?
Reconstructing deparse1()
, i.e. paste(deparse(.), collapse = " ")
, is definitely lintable, OTOH.
We could use it ourselves:
Since R 4.0.0 the pattern
deparse1(substitute(x))
seems to be recommended overdeparse(substitute(x))
. See the PR for examples: https://bugs.r-project.org/show_bug.cgi?id=17671 but this most likely will have many false positives.