From c13d530ae614fea4841ec2055570239c31989502 Mon Sep 17 00:00:00 2001
From: Holger <holger@nahrstaedt.de>
Date: Fri, 11 Jan 2019 13:41:20 +0100
Subject: [PATCH] add sonar analysis

---
 .travis.yml              |  8 +++++++-
 sonar-project.properties | 37 +++++++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+), 1 deletion(-)
 create mode 100644 sonar-project.properties

diff --git a/.travis.yml b/.travis.yml
index 1ca27cf6..8a168bff 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -63,10 +63,16 @@ before_install:
 
 script:
  - tox
+  - sed -i 's/filename="/filename=".\//g' coverage.xml
+  - ( which sonar-scanner && sonar-scanner || true )
 
 after_success:
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then bash util/package-osx.sh; fi
  - if [[ "$BUILD_LINUX" == "yes" ]]; then bash util/package-linux.sh; fi
  - coveralls
-  # - codecov 
+ - codecov 
   # - python-codacy-coverage -r coverage.xml
+
+addons:
+  sonarcloud:
+    organization: holgern-github
diff --git a/sonar-project.properties b/sonar-project.properties
new file mode 100644
index 00000000..2b8cc2d5
--- /dev/null
+++ b/sonar-project.properties
@@ -0,0 +1,37 @@
+# Metadata
+sonar.projectKey=holgern_beem
+sonar.projectName=Python Library for Steem
+sonar.projectVersion=1.0
+sonar.organization=holgern-github
+
+# Upload to sonar cloud
+sonar.host.url=https://sonarcloud.io
+ 
+# Language
+sonar.language=py
+
+# Sources
+sonar.sources=beem,beemgraphenebase,beembase,beemapi
+
+# Unit tests
+sonar.tests=./tests/
+
+# Linter
+#sonar.python.pylint=/usr/local/bin/pylint
+#sonar.python.pylint_config=.pylintrc
+#sonar.python.pylint.reportPath=pylint-report.txt 
+
+sonar.links.homepage=https://github.com/holgern/beem
+sonar.links.ci=https://travis-ci.org/holgern/beem/
+sonar.links.issue=https://github.com/holgern/beem/issues
+sonar.links.scm=https://github.com/holgern/beem/tree/master
+
+sonar.exclusions=htmlcov/*,docs/*,build/*,dist/*,*.py,tests/*
+
+# coverage
+# sonar.python.xunit.reportPath=test-reports/*.xml
+#sonar.python.coverage.reportPath=coverage.xml
+
+sonar.python.xunit.reportPath=nosetests.xml
+sonar.python.coverage.reportPath=coverage.xml
+#sonar.python.coveragePlugin=cobertura
-- 
GitLab