I want to have a pipeline in gitlab which performs static code analysis with lintr. This is the .gitlab-ci.yml:
image: r-base
variables:
ALLOWED_WARNINGS: 0
ALLOWED_NOTES: 0
NO_IMPORTS: 0
check:
script:
- Rscript -e "Sys.setenv(GITHUB_PAT = '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')"
- Rscript -e "install.packages(c('lintr', 'rcmdcheck', 'usethis', 'inteRgrate'), auth_token = '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')"
- Rscript -e "library(inteRgrate)"
- Rscript -e "check_lintr(path = '.')"
However I get the error message Error in library(inteRgrate) : there is no package called "inteRgrate"
. What is the correct way to do this?
CodePudding user response:
Should be just a question of "nested" doubled quotes. Can you try with:
- Rscript -e "check_lintr(path = '.')"
or
- Rscript -e "check_lintr(path = .)"
?
CodePudding user response:
Try adding verbose
flag to install.packages() so you can see what is going on.