The goal of this project is to get sample project for locally running SonarQube to be able to test R plugin easily.
A few hints for non-R developers to get environment for LintR up-and-running easily.
brew install r
Content for ~/.Rprofile
:
local({r <- getOption("repos")
r["CRAN"] <- "https://cloud.r-project.org"
options(repos=r)
})
Content for ~/.Renviron
if an HTTP proxy is in place:
http_proxy=http://proxy.company.com:8080
https_proxy=http://proxy.company.com:8080
Rscript -e 'install.packages(c("lintr","dplyr","devtools","roxygen2","covr","rcmdcheck","testthat"))'
Check the project is valid R project with all well-known best practices and guidelines:
Rscript -e 'devtools::check()'
Get LintR output into supported JSON format:
Rscript run_lintr.R
lintr_out.json
is created by the script.
Rscript run_cov.R
covr_out.json
is created by the script.
Run sample-project
analysis to push it into locally running instance:
cd sample-project
# -X for getting debugging information
./sonar-scanner-run.sh -X
Results will be available here: http://localhost:9000/dashboard/index/com.msd.gin.common.sonar.r:sample-project