-
Notifications
You must be signed in to change notification settings - Fork 944
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
fix(R linting): try installing the R package before linting R language #1911
fix(R linting): try installing the R package before linting R language #1911
Conversation
* the tool used to lint the R language gives false positives for files inside an R library, which is not installed * this change tries to naively install the package in the linted directory Resolves #1910
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.
@kpagacz
Sorry for such a delay on this. Have not had a lot of time lately and have been in maint mode.
Let me know if this looks good to you :)
thanks!
lib/functions/detectFiles.sh
Outdated
warn "ERROR! Failed to run:[R CMD build] at location:[${WORKSPACE_PATH}]" | ||
else | ||
# Get the build package | ||
BUILD_PKG=$(echo *.tar.gz) |
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.
@kpagacz
I'm not 100% sure how this command is working, but the other 2 make sense :)
So we do a quick check to see if we are validating R
files, and that we do have R
files to validate, then we run this block of code.
I set it to warn
and not error
as I'm guessing some people don't have build packages in their repo, and that would cause failures to install something that isn't there...
thoughts?
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.
Didn't find the Additional Installs section when I was looking through the code. Thanks for moving it here and all the improvements. My inexperience in bash is certainly showing here.
I agree this line is the weakest link. R CMD build outputs a .tar.gz file with the built package but does not give any options to customize the target path. I can try to regex the line with .tar.gz from the standard output of R CMD build (because the output from the command contains a line with the target file name) and extract the file name that way. I am unsure what's the safest way to proceed here as well.
Do you have a preference?
@kpagacz If you can give me some example code to run the r build command on, I should be able to get the last piece of this done :) |
Thank you very much for taking this over. I created an empty R repository: https://github.com/kpagacz/r-test-package You can clone it and then run the command |
@kpagacz Thanks for the test code! Thats all I needed to get this right :) SHould be able to merge once tests pass |
Fixes #1910
I am not particularly experienced in Bash and this is my first PR to this repository, so I would welcome any guidance regarding styling, direction etc.
Proposed Changes
Readiness Checklist
Author/Contributor
Reviewing Maintainer
breaking
if this is a large fundamental changeautomation
,bug
,documentation
,enhancement
,infrastructure
, orperformance