Skip to content

Commit

Permalink
Merge pull request #16 from tpiekarski/feature/integrate-sonarcloud
Browse files Browse the repository at this point in the history
Integrating SonarCloud Scanning, resolves #9
  • Loading branch information
tpiekarski authored Jul 1, 2020
2 parents 87804d3 + 1aa8e95 commit fc8577e
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 13 deletions.
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ tags
*.egg-info

# Unittest and coverage
htmlcov/*
.coverage
.pytest_cache/
.tox
junit.xml
coverage.xml
.pytest_cache/
htmlcov/*
junit.xml
pytest-report.xml

# Build folder/files
build/*
Expand Down
12 changes: 11 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ python:

cache:
directories:
- $HOME/.cache/pip
- "$HOME/.cache/pip"
- "$HOME/.sonar/cache"

install:
- pip install -r requirements.txt
Expand All @@ -24,5 +25,14 @@ script:
- make uninstall
- make clean

#
# SonarCloud Project Setup will be using automatic scanning
#
# addons:
# sonarcloud:
# organization: "tpiekarski-github"
# token:
# secure: "D9b/Hu1byz0lj2J2mJUYFjoUWuUS7b3AG2cJZyDQfm+FYXtYnEWH1pS8V5Oea/9TXQSAfTR/ZAPzB64UqbzrIb+Yt4cl7LalGlNyzYVyuBMqJlIkeKyT/r4S4HDeiIFWMbuExfFSZDtR4E7+2i5709vOaduvlnMymAv/ACnpAJN/3DsVbz0KQcBqKDrkiZa8jMLDvXxH5/fy240f3fSN/RjhFrd7dgxCssyxg9D+bDLKj8m7KWPZZc/Mg3jncwxlSJB3ta/z8L29inbHHKfww4orC3FIEUp8EVa8ov3QVHoJ+wrS1VS7okJBavztuRwBtp+XnjEgzuu/Uu2DnTYdPYac+CDxu+XMA26EhOzhSm/NmL4y0GQGJAJ02rJe1Ay6sEb9MUelEBvBJnRpODoToQOdJ2ypYmiCoAYAXvnDhhepgfnXVSw5wrLgZN8lmzGUrH7QKPTEb/OMgSV4P5BemMEUf4U6bsc5Xy41pmpqmNNXWlVBhfBKR08rk85az+8aPeGwqIAzQQAOg67BkOA+3q4WlSKCP/XbDj/05Cx5AXgLrKoPdnqVUodc4jitGB1zE2yvpWBp69j/WDP6QPgnt3FSkAzrQkUH5/vNEqR5fl/Xuq3WY4Rcma7t3PyBm2Z5XqHaYbgwlPMeyKsdy8mduXAxWeUoCQ5I7IWZV8Xu8vo="

notifications:
email: false
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ run:
$(info Testing if derl runs with $(TEST_DIRECTORY) (use args="" to pass arguments))
derl $(TEST_DIRECTORY) $(args)

sonar:
$(info Running Sonar Scanner)
sonar-scanner -Dsonar.login=${SONAR_KEY}

test:
$(info Running functional and unit tests)
python setup.py test
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# derl

[![Build Status](https://travis-ci.org/tpiekarski/derl.svg?branch=master)](https://travis-ci.org/tpiekarski/derl)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=tpiekarski_derl&metric=alert_status)](https://sonarcloud.io/dashboard?id=tpiekarski_derl)

[Overview](#overview) / [Features](#features) / [Install](#install) / [Run](#run) / [Usage](#usage) /
[Development](#development) / [Structures](#structures) / [References](#references)
Expand Down
19 changes: 10 additions & 9 deletions derl.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,29 @@
],
"settings": {
"cSpell.words": [
"DISTRIB",
"Findwork",
"Programiz",
"Pylint",
"Quickstart",
"Regexes",
"Twilio",
"Youtube",
"argparse",
"cheatsheet",
"conda",
"coveragerc",
"datefmt",
"DISTRIB",
"Findwork",
"loglevel",
"miniconda",
"outputer",
"pathlib",
"Programiz",
"Pylint",
"pyscaffold",
"pytest",
"Quickstart",
"rcompile",
"Regexes",
"repr",
"Twilio",
"virtualenv",
"Youtube"
"sonarcloud",
"virtualenv"
],
"python.pythonPath": "/usr/bin/python3"
}
Expand Down
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[pytest]
junit_family=xunit2
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ extras = True
addopts =
--cov derl --cov-report term-missing
--verbose
--junitxml=pytest-report.xml
norecursedirs =
dist
build
Expand Down
18 changes: 18 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# SonarCloud
# ---
# https://sonarcloud.io/documentation/analysis/analysis-parameters/
#

sonar.host.url=https://sonarcloud.io/
sonar.language=py
sonar.links.ci=https://travis-ci.org/tpiekarski/derl
sonar.links.homepage=https://github.com/tpiekarski/derl
sonar.links.issue=https://github.com/tpiekarski/derl/issues
sonar.links.scm=https://github.com/tpiekarski/derl
sonar.organization=tpiekarski-github
sonar.projectKey=tpiekarski_derl
sonar.projectName=derl
sonar.python.xunit.reportPath=pytest-report.xml
sonar.sourceEncoding=UTF-8
sonar.sources=src/derl
sonar.tests=tests

0 comments on commit fc8577e

Please sign in to comment.