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
Unused import linter #239
Unused import linter #239
Conversation
Codecov Report
@@ Coverage Diff @@
## master #239 +/- ##
=========================================
- Coverage 85.91% 84.4% -1.52%
=========================================
Files 39 40 +1
Lines 2179 2218 +39
=========================================
Hits 1872 1872
- Misses 307 346 +39
Continue to review full report at Codecov.
|
This looks quite useful. Should we try to get it up to speed and add tests? If so, for packages we should check for functions not used but imported in |
Yeah, I think that is right. |
fd3154a
to
a26a12f
Compare
Rebased onto current HEAD as a first step. |
@jimhester I think we have a problem for packages: WDYT about keeping it restricted to |
yeah that is true, we would have to scan for all source in the package. |
NB: |
@MichaelChirico PTAL I've updated this PR and rebased onto current master. |
# Conflicts: # man/linters.Rd
What about packages that are used to load methods? I can't think of any example off-hand, but I'm imagining |
That's exactly why the |
#1090 should fix the build issue. |
# Conflicts: # man/linters.Rd
Ready for another round of review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remind me why data.table
is excluded? maybe a simple example of a script that needs library(data.table) but doesn't include any data.table exports. Can't think of one right now.
Looks like my added test isn't caught, please check the test is right & adjust the |
It's about the |
that doesn't trigger a lint though:
|
Because it's a default? |
OK, nvm. understood. Technically, that example is not the best because users should be running
Maybe |
Well we actually have this in internal ETL code where we know for sure the RDS contains a data.table because it's written by an adjacent file. The goal of |
IINM without https://stackoverflow.com/q/28078640/3576984 Anyway, besides the point of this PR, and I'm OK with the default exceptions list. Last thing to fix is the added test for |
good to know that readRDS can mess things up - we mostly use feather locally, getting the data tables using |
This still needs some more testing, and tests written, but works with limited inputs.