Skip to content

Commit dab126d

Browse files
committed
Fix Sonarqube
1 parent 8700250 commit dab126d

File tree

7 files changed

+29
-19
lines changed

7 files changed

+29
-19
lines changed

.github/workflows/ci.yml

+12-13
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ on:
33
push:
44
branches:
55
- master
6+
- development
67
pull_request:
78
branches:
89
- master
910
- development
1011

1112
jobs:
1213
test:
14+
name: test
1315
runs-on: ubuntu-20.04
1416
services:
1517
redis:
@@ -29,41 +31,38 @@ jobs:
2931

3032
- name: Install dependencies
3133
run: |
32-
pip install -U setuptools pip
34+
pip install -U setuptools pip wheel
3335
pip install -e .[cpphash,redis,uwsgi]
3436
3537
- name: Run tests
3638
run: python setup.py test
3739

40+
- name: Set VERSION env
41+
run: echo "VERSION=$(cat splitio/version.py | grep "__version__" | awk -F\' '{print $2}')" >> $GITHUB_ENV
42+
3843
- name: SonarQube Scan (Push)
3944
if: github.event_name == 'push'
40-
uses: SonarSource/sonarcloud-github-action@v1.5
45+
uses: SonarSource/sonarcloud-github-action@v1.9
4146
env:
4247
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4349
with:
4450
projectBaseDir: .
4551
args: >
4652
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
47-
-Dsonar.projectName=${{ github.event.repository.name }}
48-
-Dsonar.projectKey=${{ github.event.repository.name }}
49-
-Dsonar.python.coverage.reportPaths=coverage.xml
50-
-Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions"
51-
-Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}"
53+
-Dsonar.projectVersion=${{ env.VERSION }}
5254
5355
- name: SonarQube Scan (Pull Request)
5456
if: github.event_name == 'pull_request'
55-
uses: SonarSource/sonarcloud-github-action@v1.5
57+
uses: SonarSource/sonarcloud-github-action@v1.9
5658
env:
5759
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5861
with:
5962
projectBaseDir: .
6063
args: >
6164
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
62-
-Dsonar.projectName=${{ github.event.repository.name }}
63-
-Dsonar.projectKey=${{ github.event.repository.name }}
64-
-Dsonar.python.coverage.reportPaths=coverage.xml
65-
-Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions"
66-
-Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}"
65+
-Dsonar.projectVersion=${{ env.VERSION }}
6766
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
6867
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
6968
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }}

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,7 @@ target/
7272
# vim backup files
7373
*.swp
7474

75-
.DS_Store
75+
.DS_Store
76+
77+
# Sonarqube
78+
.scannerwork

CONTRIBUTORS-GUIDE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ To run test you need to execute the following commands:
2828

2929
# Contact
3030

31-
If you have any other questions or need to contact us directly in a private manner send us a note at [email protected].
31+
If you have any other questions or need to contact us directly in a private manner send us a note at [email protected].

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Split Python SDK
1+
# Split Python SDK
22
![Build Status](https://github.com/splitio/python-client/actions/workflows/ci.yml/badge.svg?branch=master)
33

44
## Overview
@@ -23,7 +23,7 @@ try:
2323
factory.block_until_ready(5) # wait up to 5 seconds
2424
split = factory.client()
2525
treatment = split.get_treatment('CUSTOMER_ID', 'SPLIT_NAME')
26-
if treatment == "on":
26+
if treatment == "on":
2727
# insert code here to show on treatment
2828
elif treatment == "off":
2929
# insert code here to show off treatment

doc/source/flask_support.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ This example assumes that the Split.io configuration is save in a file called ``
3737

3838
When using the Redis client the update scripts need to be run periodically, otherwise there won't be any data available to the client.
3939

40-
As mentioned before, if the API key is set to ``'localhost'`` a localhost environment client is generated and no connections to Split.io are made as everything is read from ``.split`` file (you can read about this feature in the Localhost Environment section of the :doc:`/introduction`.)
40+
As mentioned before, if the API key is set to ``'localhost'`` a localhost environment client is generated and no connections to Split.io are made as everything is read from ``.split`` file (you can read about this feature in the Localhost Environment section of the :doc:`/introduction`.)

doc/source/index.rst

-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ Indices and tables
2020
* :ref:`genindex`
2121
* :ref:`modindex`
2222
* :ref:`search`
23-

sonar-project.properties

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
sonar.projectName=python-client
2+
sonar.projectKey=python-client
3+
sonar.python.version=3.6
4+
sonar.sources=splitio
5+
sonar.tests=tests
6+
sonar.text.excluded.file.suffixes=.csv
7+
sonar.python.coverage.reportPaths=coverage.xml
8+
sonar.links.ci=https://github.com/splitio/python-client
9+
sonar.links.scm=https://github.com/splitio/python-client/actions

0 commit comments

Comments
 (0)