diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index d04276a..b49cc39 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -45,3 +45,7 @@ jobs: uses: SonarSource/sonarqube-scan-action@v7.1.0 env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: https://sonarcloud.io + with: + args: > + -Dsonar.qualitygate.wait=true diff --git a/.gitignore b/.gitignore index e09a007..5e9bb59 100644 --- a/.gitignore +++ b/.gitignore @@ -18,5 +18,11 @@ main.js # obsidian data.json +# test coverage +coverage/ + +# Claude worktrees +.claude/ + # Exclude macOS Finder (System Explorer) View States .DS_Store diff --git a/eslint.config.mts b/eslint.config.mts index 3062c4a..324669f 100644 --- a/eslint.config.mts +++ b/eslint.config.mts @@ -30,5 +30,7 @@ export default tseslint.config( "version-bump.mjs", "versions.json", "main.js", + ".claude/**", + "coverage/**", ]), ); diff --git a/sonar-project.properties b/sonar-project.properties index f51d524..2d1fcf0 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,14 +1,20 @@ sonar.projectKey=firstsun-dev_git-files-sync sonar.organization=firstsun-dev - # This is the name and version displayed in the SonarCloud UI. -#sonar.projectName=git-files-sync -#sonar.projectVersion=1.0 +sonar.projectName=git-files-sync +sonar.projectVersion=1.1.0 +# Path is relative to the sonar-project.properties file. +sonar.sources=src +sonar.tests=tests +sonar.test.inclusions=tests/**/*.test.ts -# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. -#sonar.sources=. +# Encoding of the source code. +sonar.sourceEncoding=UTF-8 -# Encoding of the source code. Default is default system encoding -#sonar.sourceEncoding=UTF-8 +# Coverage reporting +sonar.javascript.lcov.reportPaths=coverage/lcov.info + +# Exclusions +sonar.exclusions=main.js, styles.css, node_modules/**, .claude/**, dist/**, *.config.* diff --git a/vitest.config.ts b/vitest.config.ts index ba68b1b..ee4c699 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -7,6 +7,13 @@ export default defineConfig({ setupFiles: ['./tests/setup.ts'], alias: { 'obsidian': './tests/setup.ts' - } + }, + include: ['tests/**/*.test.ts'], + exclude: ['**/node_modules/**', '**/.claude/**'], + coverage: { + include: ['src/**/*.ts'], + exclude: ['src/ui/**', 'src/main.ts', 'src/settings.ts', '**/.claude/**'], + reporter: ['text', 'json', 'html', 'lcov'], + }, }, });