-
Notifications
You must be signed in to change notification settings - Fork 187
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
Automatically add .lintr to .Rbuildignore by the use_lintr
function
#1895
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1895 +/- ##
==========================================
- Coverage 99.65% 98.86% -0.79%
==========================================
Files 113 112 -1
Lines 5166 4856 -310
==========================================
- Hits 5148 4801 -347
- Misses 18 55 +37
|
537b3f0
to
780cb2b
Compare
Is purrr causing the R 3.4 test to fail, but probably not a problem? #1870 (comment) |
db34ae5
to
780cb2b
Compare
The R 3.4 build error can be fixed by ignoring packages that import purrr for R < 3.5. However, not a big fan of introducing a dependency on usethis and fs just for this feature. |
a96d166
to
49e1acd
Compare
49e1acd
to
efe56d1
Compare
It doesn't seem to pass the test but locally it does so I don't know what is causing it. |
R/use_lintr.R
Outdated
@@ -43,5 +43,29 @@ use_lintr <- function(path = ".", type = c("tidyverse", "full")) { | |||
) | |||
) | |||
write.dcf(the_config, config_file, width = Inf) | |||
|
|||
# If this is an R package and if available, add .lintr file to .Rbuildignore | |||
if (file.exists("DESCRIPTION") && file.exists(".Rbuildignore")) { |
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.
This test looks in the current working directory, not where the config was placed.
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.
Since there is no guarantee that DESCRIPTION
and .lintr
will be placed in the same directory, I believe that the current working directory can should be used.
Sorry, finally I could not get this to work without usethis. |
Noting that this PR will fix #1805. |
Oh, I didn't realize it was already requested. Thank you for pointing that out! |
I agree about not adding either dependency. |
Close #1805
It would be useful if .lintr files were automatically added to .Rbuildignore when creating R packages.