- Install python, pip
- Install nose, coverage, nosexcover, pylint
- SonarQube Setup
- Install Sonar-Scanar
yum install python-pip
pip install nose coverage nosexcover pylint
git clone https://github.com/sduggi/sonarqube-python.git
cd sonarqube-python
Once installed, you need to execute nosetests to run your unit tests, and generate information relating to the source code. The following line runs the test runner, generates coverage information, and generates an XML test report that SonarScanner will use:
nosetests -sv --with-xunit --xunit-file=nosetests.xml --with-xcoverage --xcoverage-file=coverage.xml
cd /opt
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.4.0.2170-linux.zip
unzip sonar-scanner-cli-4.4.0.2170-linux.zip
mv sonarqube-python/sonar-scanner.properties /opt/sonar-scanner-4.4.0.2170-linux/conf/sonar-scanner.properties
cd /opt/sonar-scanner-cli-4.4.0.2170-linux/bin
./sonar-scanner