From 195b3d7214e14bfbec8550ea9011f37908255f0b Mon Sep 17 00:00:00 2001 From: jorge_rabello Date: Sun, 8 Sep 2024 02:08:30 -0300 Subject: [PATCH] feat: add sonarcloud --- .github/workflows/ci.yaml | 5 +++++ sonar-project.properties | 5 +++-- sum.go | 16 ---------------- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 67103fc..0a0f397 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,3 +13,8 @@ jobs: with: go-version: 1.23.1 - run: go test -coverprofile=coverage.out + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties index 8d26bcd..39c8dba 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,8 +1,9 @@ -sonar.projectKey=go-project +sonar.projectKey=jorgerabello3_fc2-sonarcloud +sonar.organization=jorgerabello3 sonar.sources=. sonar.exclusions=**/*_test.go sonar.tests=. sonar.test.inclusions=**/*_test.go -sonar.go.coverage.reportPaths=coverage.out \ No newline at end of file +sonar.go.coverage.reportPaths=coverage.out diff --git a/sum.go b/sum.go index 9af670b..bece47f 100644 --- a/sum.go +++ b/sum.go @@ -9,19 +9,3 @@ func main() { func sum(a int, b int) int { return a + b } - -func sub(a int, b int) int { - return a - b -} - -func div(a int, b int) int { - return a / b -} - -func times(a int, b int) int { - return a * b -} - -func suX(a int, b int) int { - return a + b + b -}