Add SonarQube analysis

Signed-off-by: Steven Kriegler <sk.bunsenbrenner@gmail.com>
This commit is contained in:
justusbunsi 2021-10-17 12:16:42 +02:00
parent 8a7e9f83fa
commit 24e4249411
No known key found for this signature in database
GPG key ID: 82B29BF2507F9F8B
4 changed files with 23 additions and 1 deletions

2
.gitignore vendored
View file

@ -1,6 +1,7 @@
/.git/
/.idea/
/.vscode/
/.scannerwork/
/config/
/vendor/
/gitea-sonarqube-bot
@ -8,3 +9,4 @@
/*.log
/cover.out
/cover.html
/test-report.out

View file

@ -25,7 +25,7 @@ run:
clean:
go clean
rm -f ${BINARY_NAME}
rm -f cover.out cover.html
rm -f cover.out cover.html test-report.out
test:
ifdef p
@ -37,6 +37,9 @@ endif
test\#%:
go test -mod=vendor -run $(subst .,/,$*) ./...
test-ci:
go test -mod=vendor -coverprofile=cover.out -json ./... > test-report.out
coverage:
go test -coverprofile=cover.out ./...
go tool cover -html=cover.out -o cover.html

View file

@ -1,5 +1,7 @@
# Gitea SonarQube Bot
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=gitea-sonarqube-bot&metric=alert_status)](https://sonarcloud.io/dashboard?id=gitea-sonarqube-bot)
_Gitea SonarQube Bot_ is a bot that receives messages from both SonarQube and Gitea to help developers
being productive. The idea behind this project is the missing ALM integration of Gitea in SonarQube. Unfortunately,
this [won't be added in near future](https://github.com/SonarSource/sonarqube/pull/3248#issuecomment-701334327).

15
sonar-project.properties Normal file
View file

@ -0,0 +1,15 @@
sonar.sourceEncoding=UTF-8
sonar.host.url=https://sonarcloud.io
sonar.organization=justusbunsi
sonar.projectKey=gitea-sonarqube-bot
sonar.projectName=Gitea SonarQube Bot
sonar.sources=.
sonar.exclusions=**/*_test.go,contrib/**,docker/**,docs/**,helm/**
sonar.tests=.
sonar.test.inclusions=**/*_test.go
sonar.go.tests.reportPaths=test-report.out
sonar.go.coverage.reportPaths=cover.out