Skip to content

Commit f3c13ab

Browse files
committed
fix(sonar): properly separate test files from source analysis
Add test file exclusions from source analysis and explicitly declare test file paths. This ensures test code duplication doesn't count towards the quality gate's duplication threshold.
1 parent a2ac0b5 commit f3c13ab

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sonar-project.properties

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ sonar.organization=sunet
77

88
# Source configuration
99
sonar.sources=.
10-
sonar.exclusions=vendor/**,**/testdata/**
10+
sonar.exclusions=vendor/**,**/testdata/**,**/*_test.go
11+
sonar.tests=.
12+
sonar.test.inclusions=**/*_test.go
1113

12-
# Exclude test files from duplication detection
14+
# Exclude test files from duplication detection (CPD - Copy Paste Detection)
1315
# Test code intentionally contains similar patterns for comprehensive coverage
1416
sonar.cpd.exclusions=**/*_test.go
1517

0 commit comments

Comments
 (0)