Skip to content
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

False positive [unused_import_linter] #2042

Closed
tonyk7440 opened this issue Aug 4, 2023 · 1 comment · Fixed by #2143
Closed

False positive [unused_import_linter] #2042

tonyk7440 opened this issue Aug 4, 2023 · 1 comment · Fixed by #2143
Assignees
Labels
false-positive code that shouldn't lint, but does
Milestone

Comments

@tonyk7440
Copy link
Contributor

It seems like when using a function inside a glue() call, this lintr doesn't recognise a function is being used.
An example

library(praise)

glue::glue(
  "Hi Team,
          
          {praise()}  

          All the best"
)

Which is flagged as
[unused_import_linter] Package 'praise' is attached but never used.

@tonyk7440 tonyk7440 changed the title False positives [unused_import_linter] False positive [unused_import_linter] Aug 4, 2023
@MichaelChirico MichaelChirico added the false-positive code that shouldn't lint, but does label Aug 4, 2023
@MichaelChirico
Copy link
Collaborator

We should be able to reuse the logic from object_usage_linter() to extract usages from within glue() literals... Assigning to @IndrajeetPatil for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
false-positive code that shouldn't lint, but does
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants