Skip to content

Auto-detect imported objects from packages in object_usage_linter()#1136

Merged
MichaelChirico merged 2 commits intomasterfrom
feature/1127-object_usage-imports
May 16, 2022
Merged

Auto-detect imported objects from packages in object_usage_linter()#1136
MichaelChirico merged 2 commits intomasterfrom
feature/1127-object_usage-imports

Conversation

@AshesITR
Copy link
Copy Markdown
Collaborator

Partially fixes #1127.
The example provided in the original issue is more complex because library(tidyverse) doesn't export the functions used.
Instead, it attaches other packages as a side-effect. I don't have a good idea how to (without acutally running library(...)) detect these.

IIRC, the packages aren't even registered as Depends.

@MichaelChirico
Copy link
Copy Markdown
Collaborator

IMO it's a tidyverse bug that its dependencies aren't so declared, but maybe we're missing something... added a comment to the existing bug requesting clarification:

tidyverse/tidyverse#40 (comment)

@MichaelChirico
Copy link
Copy Markdown
Collaborator

LGTM here. I'm surprised this wasn't done previously 😳

@MichaelChirico MichaelChirico merged commit f962bd0 into master May 16, 2022
@MichaelChirico MichaelChirico deleted the feature/1127-object_usage-imports branch May 16, 2022 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

no visible global variables (object-usage-linter) is still a matter

2 participants