Commit e839c02
committed
feat: add .sonarcloud.properties with explicit src-only inclusion
Create .sonarcloud.properties file which takes precedence over
sonar-project.properties for SonarCloud scans. Use whitelist approach
to ONLY scan src/ directory.
**Key Strategy Change:**
Instead of trying to exclude test files (blacklist), explicitly
include ONLY src files (whitelist):
```properties
sonar.sources=src
sonar.inclusions=src/**/*.ts
```
This tells SonarCloud to ONLY scan TypeScript files in src/ directory,
completely ignoring everything else including tests/.
**Additional Safeguards:**
1. **Issue ignore rules (e1-e7)**
- e1-e3: Ignore ALL rules in tests/**, *.test.ts, *.spec.ts
- e4-e5: Specifically target typescript:S4036 and S* rules
- e6-e7: Explicitly ignore problem files by name
2. **Multiple exclusion layers**
- sonar.exclusions
- sonar.coverage.exclusions
- sonar.cpd.exclusions
- sonar.security.exclusions
- sonar.global.exclusions
**Why .sonarcloud.properties:**
- SonarCloud specifically looks for this file first
- Takes precedence over sonar-project.properties
- More reliable for cloud-specific configuration
**Expected Result:**
- SonarCloud should ONLY analyze src/**/*.ts files
- All test files completely excluded from scanning
- No more S4036 PATH security warnings from test files1 parent dfa64b3 commit e839c02
1 file changed
Lines changed: 53 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
0 commit comments