我想在gitlab中有一个使用lintr执行静态代码分析的管道。这是.gitlab-ci.yml:
image: r-base
variables:
ALLOWED_WARNINGS: 0
ALLOWED_NOTES: 0
NO_IMPORTS: 0
check:
script:
- Rscript -e "Sys.setenv(GITHUB_PAT = 'my_pat')"
- Rscript -e "install.packages(c('lintr', 'rcmdcheck', 'usethis', 'remotes'))"
- Rscript -e "remotes::install_github('jumpingrivers/inteRgrate', auth_token = 'my_pat')"
- Rscript -e "inteRgrate::check_lintr(path = '.')"//EDIT但是我得到了这个错误信息:
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
ERROR: dependencies ‘lintr’, ‘rcmdcheck’, ‘usethis’ are not available for package ‘inteRgrate’
* removing ‘/usr/local/lib/R/site-library/inteRgrate’
There were 11 warnings (use warnings() to see them)
$ Rscript -e "inteRgrate::check_lintr(path = '.')"
Error in loadNamespace(x) : there is no package called ‘inteRgrate’
Calls: loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1执行此操作的正确方法是什么?
发布于 2021-11-30 17:30:39
应该只是一个“嵌套”双引号的问题。这些语法可以接受吗?
- Rscript -e 'check_lintr(path = ".")'或
- Rscript -e "check_lintr(path = .)"正如r2evans在注释中建议的那样,这应该是一个更简单的语法:
- Rscript -e "check_lintr()"发布于 2021-11-30 21:13:42
尝试向install.packages()添加verbose标志,这样就可以看到发生了什么。
https://stackoverflow.com/questions/70172287
复制相似问题