Make the coverage.config obj exclusion match on Linux - #55
Conversation
The source exclusion was written with Windows path separators (.*\obj\.*), so on the Linux CI runners it matched nothing, and source-generated files under obj/ (Refit clients, logging generators) were counted towards coverage. [\/] matches either separator. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Coverage variation | ✅ +0.00% coverage variation (-1.00%) |
| Diff coverage | ✅ ∅ diff coverage |
Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (329893b) 3023 2543 84.12% Head commit (44e969f) 3023 (+0) 2543 (+0) 84.12% (+0.00%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>
Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#55) 0 0 ∅ (not applicable) Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
… Windows The obj source exclusion was written with Windows-only path separators, so on the Linux CI runners it matched nothing, and source-generated files under obj/ (Refit clients, logging generators) were counted towards coverage. The pattern now uses a character class matching either separator. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull Request Overview
While this PR correctly identifies the need for cross-platform path separators in coverage.config, the implementation is incomplete. The updated regex for the obj directory fails to account for relative paths starting with 'obj/', and the Benchmarks exclusion was left unchanged, leaving it broken for Linux environments. Although Codacy reports the PR is up to standards, these logic gaps will prevent the exclusions from working as intended on Linux CI runners.
About this PR
- The exclusion pattern for the
Benchmarksdirectory still uses Windows-specific backslashes and a potentially incorrect regex sequence (\B), which will likely fail on Linux and might not behave as intended even on Windows.
Test suggestions
- Verify that files in the
obj/directory are excluded from coverage on Linux runners. - Verify that files in the
obj/directory are excluded from coverage on Windows workstations.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify that files in the `obj/` directory are excluded from coverage on Linux runners.
2. Verify that files in the `obj/` directory are excluded from coverage on Windows workstations.
TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback
| <Sources> | ||
| <Exclude> | ||
| <Source>.*\obj\.*</Source> | ||
| <Source>.*[\\/]obj[\\/].*</Source> |
There was a problem hiding this comment.
🟡 MEDIUM RISK
This pattern requires a preceding separator, meaning it will not match relative paths starting with obj/. To support both absolute and relative paths, allow the start of the string as an alternative to the separator.
| <Source>.*[\\/]obj[\\/].*</Source> | |
| <Source>.*([\\/]|^)obj[\\/].*</Source> |
| <Exclude> | ||
| <Source>.*\obj\.*</Source> | ||
| <Source>.*[\\/]obj[\\/].*</Source> | ||
| <Source>.*\Benchmarks\.*</Source> |
There was a problem hiding this comment.
⚪ LOW RISK
Suggestion: The Benchmarks exclusion should be updated to use the same cross-platform path separator pattern as the obj directory to ensure consistency and correct behavior on Linux. Additionally, \B is likely being interpreted as a regex anchor rather than a path component.
| <Source>.*\Benchmarks\.*</Source> | |
| <Source>.*[\\/]Benchmarks[\\/].*</Source> |
The
coverage.configsource exclusion forobjwas written with Windows-only path separators, so on our Linux CI runners it matched nothing, and source-generated files underobj/(Refit clients, logging generators) counted towards coverage. Measured before the fix: Meraki.Api's coverage report included 29 such files, PanoramicData.OData.Client's 1.The pattern is now
.*[\\/]obj[\\/].*, which matches either separator, so it works on both the Linux runners and Windows workstations.Tracked on OPS-157454.
🤖 Generated with Claude Code