Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/badge/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ inputs:
default: 'true'
version:
description: dotcov.tool version to install.
default: '1.7.1'
default: '2.0.0'
command:
description: >-
Command that runs dotcov instead of installing it, split on whitespace, e.g.
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<!-- Versioning: CI passes -p:Version=x.y.z -->
<PropertyGroup>
<VersionPrefix Condition="'$(VersionPrefix)' == ''">1.7.1</VersionPrefix>
<VersionPrefix Condition="'$(VersionPrefix)' == ''">2.0.0</VersionPrefix>
<VersionSuffix Condition="'$(VersionSuffix)' == ''">local</VersionSuffix>
<Version Condition="'$(VersionSuffix)' != ''">$(VersionPrefix)-$(VersionSuffix)</Version>
<Version Condition="'$(VersionSuffix)' == ''">$(VersionPrefix)</Version>
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
Turn Cobertura XML into a build decision — a table, a markdown block, a JSON payload, and an
exit code your CI can act on. Local by default; uploads are opt-in.

## Migrating from 0.x
## Migrating from 1.x

Version 1.0 replaces `DotCov.Nuke` with `DotCov.Fallout` and separates report discovery from
XML parsing (`ReportResolver.Resolve` replaces the parser's path methods). See the
[1.0 migration notes](docs/releases/1.0.0.md) for both upgrades.
Version 2.0 counts some reports differently. Line totals of istanbul reports (Jest, Vitest) drop
to the tool's own, and coverage.py reports with several `source` roots resolve each file against
its own root. Commands, flags and exit codes are unchanged. Check thresholds and badges set on
1.x numbers; the [2.0 release notes](docs/releases/2.0.0.md) have the details. Coming from 0.x,
read the [1.0 migration notes](docs/releases/1.0.0.md) first.

## Getting started

Expand Down Expand Up @@ -176,7 +178,7 @@ permissions:

steps:
# … checkout, setup-dotnet, and a test run writing Cobertura to TestResults/
- uses: ANcpLua/dotcov/.github/actions/badge@v1.7.1
- uses: ANcpLua/dotcov/.github/actions/badge@v2.0.0
with:
reports: TestResults
min-line: 80
Expand Down Expand Up @@ -222,5 +224,5 @@ fallout Coverage # tests plus the coverage gate
## Feedback

[Issues](https://github.com/ANcpLua/dotcov/issues) ·
[Release notes](docs/releases/1.7.1.md) ·
[Release notes](docs/releases/2.0.0.md) ·
[MIT](LICENSE)
37 changes: 37 additions & 0 deletions docs/releases/2.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# DotCov 2.0.0

The same Cobertura report can produce different numbers than in 1.x. Two parser fixes change
what DotCov counts, so thresholds and badges set on 1.x numbers can move. Commands, flags,
exit codes and the JSON shape are unchanged.

## What changes in your numbers

- **istanbul reports (Jest, Vitest): line totals now equal the tool's own.** istanbul lists each
function's declaration line under `<methods>`, and 1.x counted those lines as file lines. A
class's own `<lines>` now decide its file's lines; method lines count only for a class that has
no `<lines>` of its own. Coverlet's totals do not change. On ten Vitest reports from the MCP
TypeScript SDK, every line total now equals Vitest's; with 1.7.1, all ten were higher, by up to
823 lines.
- **coverage.py with several `source` roots: each file keeps its own root.** 1.x prefixed every
relative file name with the first `<source>`. A file now resolves against the root under which
it exists on disk, so run DotCov where the sources are checked out. When the file exists under
no root or under several, the first root applies and the report keeps the multi-root warning.
On the MCP Python SDK's report (three roots, 414 files), 413 files now resolve to their real
paths.
- The multi-root warning now appears only when a file stays ambiguous, not for every report
with several roots.

## What DotCov cannot change

istanbul attaches branches only to lines that hold statements. A branch on any other line exists
only in the report's header totals, so DotCov's branch count can stay below Jest's or Vitest's
summary. The README's TypeScript section says so too.

## Upgrade

```bash
dotnet tool update -g DotCov.Tool --version 2.0.0
```

Update the badge action to `ANcpLua/dotcov/.github/actions/badge@v2.0.0` and the `DotCov` and
`DotCov.Fallout` package references to `2.0.0`.
Loading