Question:
In .sonarcloud.properties I have the following, but I continue to get code smell alerts on test files including copy duplication code smell.
One guess about why is that I need to have a wildcard to specify the directory. Maybe I need **/*.text.js? Another guess is that SonarCloud ignores this file. Another guess is that I don’t know how to specify more than one exclusion in sonar.exclusions. Is it a comma with no spaces. Where are the docs for .sonarcloud.properties that covers these details. The stuff I found had no examples for multiple exclusions or matching those files in any path.
# Path to sources
# sonar.sources=
sonar.exclusions=package-lock.json,*.test.js
# sonar.inclusions=
# Path to tests
# sonar.tests=
# sonar.test.exclusions=
# sonar.test.inclusions=
# Source encoding
# sonar.sourceEncoding=
# Exclusions for copy-paste detection
sonar.cpd.exclusions=*.test.js
# Python version (for python projects only)
# sonar.python.version=
I just setup the GitHub Action so I can get code coverage info. sonar-project.properties seems to duplicate the settings in .sonarcloud.properties. I’m guessing that I only need the sonar-project.properties now. Is it safe to delete .sonarcloud.properties?
If you’re moving to CI-based analysis for code coverage, then .sonarcloud.properties will be ignored and you should be safe to transfer that configuration to a sonar-project.properties file.
Again thanks. How are status checks returned in CI-based analysis? I’m hoping they are still asynchrnous like the automated response… If not, I’m hoping they run really fast. I’d hate for my GitHub Action workflow to hang for minutes while SonarCloud analyzes my project.