From 159110a72b94d2b1898729d4e9bd293d5a3c35a8 Mon Sep 17 00:00:00 2001 From: Gil Barbara Date: Fri, 27 Oct 2023 19:06:18 -0300 Subject: [PATCH] Add sonarcloud config - remove codeclimate config --- .codeclimate.yml | 32 -------------------------------- .github/workflows/main.yml | 7 ++++--- README.md | 2 +- sonar-project.properties | 6 ++++++ 4 files changed, 11 insertions(+), 36 deletions(-) delete mode 100644 .codeclimate.yml create mode 100644 sonar-project.properties diff --git a/.codeclimate.yml b/.codeclimate.yml deleted file mode 100644 index fe7bad79..00000000 --- a/.codeclimate.yml +++ /dev/null @@ -1,32 +0,0 @@ - -version: "2" -checks: - argument-count: - config: - threshold: 4 - complex-logic: - config: - threshold: 4 - file-lines: - config: - threshold: 500 - identical-code: - config: - threshold: 50 - method-complexity: - config: - threshold: 20 - method-count: - config: - threshold: 20 - method-lines: - config: - threshold: 50 - similar-code: - config: - threshold: 100 -exclude_patterns: - - coverage/**/* - - dist/**/* - - node_modules/**/* - - test/**/* diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e9b41907..1a6df45a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -63,11 +63,12 @@ jobs: path: playwright-report/ retention-days: 30 - - name: Publish code coverage + - name: SonarCloud Scan if: "!startsWith(github.ref, 'refs/tags/')" - uses: paambaati/codeclimate-action@v3.0.0 + uses: SonarSource/sonarcloud-github-action@master env: - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - name: Publish Package if: startsWith(github.ref, 'refs/tags/') diff --git a/README.md b/README.md index 699a5cd0..6a29c4b9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # React Joyride -[![](https://badge.fury.io/js/react-joyride.svg)](https://www.npmjs.com/package/react-joyride) [![CI](https://github.com/gilbarbara/react-joyride/actions/workflows/main.yml/badge.svg)](https://github.com/gilbarbara/react-joyride/actions/workflows/main.yml) [![](https://api.codeclimate.com/v1/badges/43ecb5536910133429bd/maintainability)](https://codeclimate.com/github/gilbarbara/react-joyride/maintainability) [![](https://api.codeclimate.com/v1/badges/43ecb5536910133429bd/test_coverage)](https://codeclimate.com/github/gilbarbara/react-joyride/test_coverage) +[![](https://badge.fury.io/js/react-joyride.svg)](https://www.npmjs.com/package/react-joyride) [![CI](https://github.com/gilbarbara/react-joyride/actions/workflows/main.yml/badge.svg)](https://github.com/gilbarbara/react-joyride/actions/workflows/main.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=gilbarbara_react-joyride&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=gilbarbara_react-joyride) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=gilbarbara_react-joyride&metric=coverage)](https://sonarcloud.io/summary/new_code?id=gilbarbara_react-joyride) [![Joyride example image](http://gilbarbara.com/files/react-joyride.png)](https://react-joyride.com/) diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 00000000..77f897c2 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,6 @@ +sonar.projectKey=gilbarbara_react-joyride +sonar.organization=gilbarbara-github +sonar.source=./src +sonar.javascript.lcov.reportPaths=./coverage/lcov.info +sonar.exclusions=**/demo/**/*.*,**/test/**/*.* +sonar.coverage.exclusions=**/test/**/*.*,**/jest.config.ts