Skip to content

ci(sonar): exclude tests from duplication via .sonarcloud.properties - #202

Merged
sirdeggen merged 1 commit into
mainfrom
fix/sonarcloud-cpd-exclusions
Jun 16, 2026
Merged

ci(sonar): exclude tests from duplication via .sonarcloud.properties#202
sirdeggen merged 1 commit into
mainfrom
fix/sonarcloud-cpd-exclusions

Conversation

@sirdeggen

Copy link
Copy Markdown
Contributor

Summary

SonarCloud here runs Automatic Analysis, which reads .sonarcloud.propertiesnot sonar-project.properties. The sonar.cpd.exclusions added to sonar-project.properties in #200 therefore had no effect, and pre-existing test-file duplication kept failing the new_duplicated_lines_density gate on PRs that merely touch those files (e.g. #197).

Changes

  • Add .sonarcloud.properties with sonar.cpd.exclusions covering test files (**/*.test.ts, **/test/**, etc.) and *.vectors.ts. Parallel test suites (SQLite vs IndexedDB variants) legitimately duplicate large blocks; tests are already excluded from sources/coverage analysis. Source-code duplication is still fully analyzed.

Test plan

SonarCloud Automatic Analysis reads .sonarcloud.properties, not
sonar-project.properties, so the cpd.exclusions added there had no effect.
Add the file with sonar.cpd.exclusions covering test files: parallel test
suites (DB vs IndexedDB variants) legitimately duplicate large blocks, which
was failing the new-code duplication gate on PRs that merely touch them (#197).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sirdeggen
sirdeggen merged commit 115a268 into main Jun 16, 2026
6 checks passed
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant