Merge pull request #5872 from inspec/cw/set-coverage-location

CFINSPEC-39 Set sonarscanner options using properties file
This commit is contained in:
Clinton Wolfe 2022-02-27 19:58:09 -05:00 committed by GitHub
commit 275eb2b2f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

View file

@ -61,10 +61,15 @@ if [ -n "${CI_ENABLE_COVERAGE:-}" ]; then
export PATH=$SONAR_SCANNER_HOME/bin:$PATH
export SONAR_SCANNER_OPTS="-server"
# Delete the vendor/ directory. I've tried to exclude it using sonar.exclusions,
# but that appears to get ignored, and we end up analyzing the gemfile install
# which blows our analysis.
echo "--- deleting installed gems"
rm -rf vendor/
# See sonar-project.properties for additional settings
echo "--- running sonarscanner"
sonar-scanner \
-Dsonar.organization=inspec \
-Dsonar.projectKey=inspec_inspec \
-Dsonar.sources=. \
-Dsonar.host.url=https://sonarcloud.io
fi

8
sonar-project.properties Normal file
View file

@ -0,0 +1,8 @@
sonar.ruby.coverage.reportPaths=coverage/coverage.json
sonar.projectKey=inspec_inspec
sonar.organization=inspec
sonar.coverage.exclusions=test/*,lib/plugins/*/test/*
sonar.exclusions=**/*.java,**/*.js,vendor/*
sonar.c.file.suffixes=-
sonar.cpp.file.suffixes=-
sonar.objc.file.suffixes=-