You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although the code in R itself doesn't follow its own recommendations, it would be nice to lint for times when a variable is defined which overrides the name of something in a base or recommended package. I imagine it would be easy to string match against the contents of those namespaces.
E.g., I would love a lints for:
version <- "version is a 'simple.list' in the base package"
names <- c("alice", "bob") # oh no, names is a function in base
This can lead to problems, e.g. when editing the variable declaration, but not updating subsequent uses, since the symbol will still be found, but will often be for a closure, giving opaque errors.
This would apply to both variables defined within functions, and function arguments, so the following would also be good to lint:
Maybe reusing logic from the object_usage_linter and checking for collisions of all of the found symbols within the base & recommended packages would be a lightweight way to implement this.
That way we wouldn't need a list of all bad object names, but instead dynamically check the (presumably fewer) used symbols against a bunch of loaded namespaces.
Although the code in R itself doesn't follow its own recommendations, it would be nice to lint for times when a variable is defined which overrides the name of something in a base or recommended package. I imagine it would be easy to string match against the contents of those namespaces.
E.g., I would love a lints for:
This can lead to problems, e.g. when editing the variable declaration, but not updating subsequent uses, since the symbol will still be found, but will often be for a closure, giving opaque errors.
This would apply to both variables defined within functions, and function arguments, so the following would also be good to lint:
The text was updated successfully, but these errors were encountered: