Broaden sonarCoverageExclusions to a full sonarExclusions - #72
Conversation
Rename the CoverageOptions property to sonarExclusions and wire it to sonar.exclusions instead of sonar.coverage.exclusions, so matched paths are excluded from all Sonar analysis (coverage, duplication, issues). This is the path-based analogue of skipping a whole module, and lets generated code (e.g. near-identical OpenAPI network models) be excluded from the duplication gate while staying internal.
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
WalkthroughThe plugin renames ChangesUnified Sonar exclusions
Estimated code review effort: 1 (Trivial) | ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
README.md (1)
51-53: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winClarify that the exclusion applies to source files.
Sonar defines
sonar.exclusionsfor source files, while test files usesonar.test.exclusions. The phrase “excluded from all analysis” can mislead consumers who expect test files to be excluded too. (docs.sonarsource.com)Suggested wording
- // Additional Sonar exclusion patterns for file paths, excluded from all analysis - // (coverage, duplication, issues) (default: empty) + // Additional Sonar source-file exclusion patterns for coverage, duplication, + // and issue analysis (default: empty)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@README.md` around lines 51 - 53, Update the README comment above sonarExclusions to state that these patterns exclude source files from Sonar analysis, not test files; preserve the existing configuration and clarify that test exclusions use sonar.test.exclusions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@README.md`:
- Around line 51-53: Update the README comment above sonarExclusions to state
that these patterns exclude source files from Sonar analysis, not test files;
preserve the existing configuration and clarify that test exclusions use
sonar.test.exclusions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 12370744-8f50-479f-bf90-37b453561635
📒 Files selected for processing (3)
README.mdplugin/src/main/kotlin/io/getstream/android/coverage/CoverageConfiguration.ktplugin/src/main/kotlin/io/getstream/android/coverage/CoverageOptions.kt
Goal
Closes AND-1362
coverage.sonarCoverageExclusionsonly mapped tosonar.coverage.exclusions, which silences coverage but not duplication. Generated OpenAPI network models are near-identical by design and trip SonarCloud's duplication gate, and a coverage-only exclusion cannot silence that.Implementation
CoverageOptions.sonarCoverageExclusionstosonarExclusions.sonar.exclusions(full) instead ofsonar.coverage.exclusions, so matched paths drop from coverage, duplication, and issues. This is the path-based analogue of skipping a whole module.Breaking: consumers using the old property name must rename it. Full exclusion also drops matched paths from issue analysis, not just coverage.
Testing
Sonar analysis should exclude the configured paths from all metrics (coverage, duplication, issues).
Summary by CodeRabbit
New Features
sonarExclusionsfor clearer configuration.Documentation