-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expect_lint() error for missing {testthat} should reference which function called it #2585
Comments
I am thinking something along the line of:
I am not sure if there would be a more elegant way to get this info which function did the original call. Or you create a third unexported function called "expect_lint_logic" who does all the heavy lifting and has an addition parameter which is simply the name of the calling function. Any better ideas? I wanted to write the expect_no_lint_linter as well, given that this should be a fairly easy linter to write as it just needs to check for NULL on the second positional parameter of the function, as far as I understood the xpath logic |
Follow #1874 for some discussion about how exactly to go about that. We might want something more generalizable than just |
Regarding the caller logic, you can look at the code of |
I would use: tail(as.character(sys.call(sys.parent())[[1]]), 1L) That covers The Alternatively, we can just copy-paste the |
This is the way to go I think. |
Probably the most simple solution indeed. |
Originally posted by @MichaelChirico in #2582 (comment)
The text was updated successfully, but these errors were encountered: