Skip to content

Commit d5e477d

Browse files
committed
sonarcloud integration
1 parent e914823 commit d5e477d

File tree

4 files changed

+24
-13
lines changed

4 files changed

+24
-13
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ vendor/
99
nbactions.xml
1010
.nb-gradle/
1111
.vscode/
12+
.scannerwork/
1213
.DS_Store
1314
### JetBrains template
1415
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm

.travis.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,32 @@
1+
dist: xenial
2+
addons:
3+
# sonar-scanner run inside test.sh
4+
sonarcloud:
5+
organization: "simukti"
16
language: go
2-
37
go:
48
- 1.11.x
59
- 1.12.x
610
- 1.13.x
711
- 1.14.x
812
- 1.15.x
913
- master
10-
1114
matrix:
1215
fast_finish: true
1316
allow_failures:
1417
- go: master
15-
1618
git:
1719
depth: 1
18-
1920
env:
2021
- GO111MODULE=on
21-
2222
install: true
23-
2423
branches:
2524
only:
2625
- master
27-
2826
before_install:
2927
- go get -u -v github.com/mattn/goveralls
30-
31-
# golangci.com will be closed on 2020-04-15
32-
# https://medium.com/golangci/golangci-com-is-closing-d1fc1bd30e0e
3328
before_script:
3429
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.33.0
35-
3630
script: ./test.sh
37-
3831
after_success:
3932
- $GOPATH/bin/goveralls -v -coverprofile=coverage.out -service=travis-ci -repotoken=$COVERALLS_TOKEN

sonar-project.properties

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
sonar.projectKey=simukti_sqldb-logger
2+
sonar.projectName=sqldb-logger
3+
sonar.issuesReport.html.enable=true
4+
sonar.sources=.
5+
sonar.exclusions=**/*_test.go,\
6+
**/vendor/**,\
7+
**/*.yml,\
8+
**/*.md,\
9+
**/go.*,\
10+
**/coverage*,\
11+
**/*.git*,\
12+
**/Makefile
13+
sonar.tests=.
14+
sonar.test.inclusions=**/*_test.go
15+
sonar.test.exclusions=**/vendor/**
16+
sonar.go.coverage.reportPaths=./coverage.out

test.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ ls -d logadapter/* | xargs -I {} bash -c "cd '{}' \
99
&& cat coverage.out | grep -v \"mode:\" >> ../../coverage.out \
1010
&& rm coverage.out"
1111
# for go repo with nested modules, remove repo prefix, otherwise goveralls will failed.
12-
sed -i -e 's/github.com\/simukti\/sqldb-logger/./g' coverage.out
12+
sed -i -e 's/github.com\/simukti\/sqldb-logger/./g' coverage.out
13+
sonar-scanner

0 commit comments

Comments
 (0)