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
S3 inheritance should be ignored #223
Comments
@fangly Can you look into this regression and add an additional test for it, thanks! |
To enfore a given naming style, e.g. "snake_case":
In short, before, you got some false positive and some false negative lints, and now you should only get some false positives. False positives are annoying, but you can ignore them with a "#nolint" comment. False negatives are more problematic, because as a user, you cannot do anything against them. Workarounds and solutions:
What are your thoughts? |
We could load the package namespace like was done previously and get the defined generics that way. The downside is if the project is not a package or if the package is not installed the generics won't be found. Alternatively we can parse all project code regardless of which file is being linted and whitelist S3 generics. This approach would also be useful for the The latter can be done by using the |
I'd like to add my vote for this issue after encountering a lint for a |
This seems to be fixed in the current master. |
It seems that this is not fixed for $ cat lintr.data.frame.R
f <- function(x, ...) UseMethod("f", x)
f.data.frame <- function(x) x
$ Rscript -e 'lintr::lint("lintr.data.frame.R")'
lintr.data.frame.R:2:1: style: Variable and function name style should be snake_case.
f.data.frame <- function(x) x
^~~~~~~~~~~~ This is from current master (d86407d). |
@jimhester Regarding my comment above, would you consider reopening this or should I rather open a new issue? |
Since 27a5d95, S3 objects are incorrectly linted
Reproducible example:
The text was updated successfully, but these errors were encountered: