Merge pull request #9 from firstsun-dev/fix/sonarcloud-failure

fix: SonarCloud analysis failure and quality gate issues
This commit is contained in:
ClaudiaFang 2026-04-25 14:13:03 +08:00 committed by GitHub
commit 63f80530a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 33 additions and 8 deletions

View file

@ -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

6
.gitignore vendored
View file

@ -18,5 +18,11 @@ main.js
# obsidian
data.json
# test coverage
coverage/
# Claude worktrees
.claude/
# Exclude macOS Finder (System Explorer) View States
.DS_Store

View file

@ -30,5 +30,7 @@ export default tseslint.config(
"version-bump.mjs",
"versions.json",
"main.js",
".claude/**",
"coverage/**",
]),
);

View file

@ -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.*

View file

@ -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'],
},
},
});