FsHotWatch.Coverage 0.7.0-alpha.8

This is a prerelease version of FsHotWatch.Coverage.
dotnet add package FsHotWatch.Coverage --version 0.7.0-alpha.8
                    
NuGet\Install-Package FsHotWatch.Coverage -Version 0.7.0-alpha.8
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FsHotWatch.Coverage" Version="0.7.0-alpha.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FsHotWatch.Coverage" Version="0.7.0-alpha.8" />
                    
Directory.Packages.props
<PackageReference Include="FsHotWatch.Coverage" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FsHotWatch.Coverage --version 0.7.0-alpha.8
                    
#r "nuget: FsHotWatch.Coverage, 0.7.0-alpha.8"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FsHotWatch.Coverage@0.7.0-alpha.8
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FsHotWatch.Coverage&version=0.7.0-alpha.8&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=FsHotWatch.Coverage&version=0.7.0-alpha.8&prerelease
                    
Install as a Cake Tool

FsHotWatch.Coverage

Plugin that checks per-file line and branch coverage thresholds after each test run, using Cobertura XML reports produced by the test runner.

Why

Coverage enforcement is usually a separate CI step that runs after all tests. With FsHotWatch, CoveragePlugin reacts to TestRunCompleted events and checks thresholds immediately, giving you instant feedback when a change drops coverage below the minimum.

How it works

  1. TestPrune runs your tests (with coverage flags wired via coveragePaths)
  2. Tests produce coverage.cobertura.xml reports under searchDir
  3. CoveragePlugin receives TestRunCompleted
  4. It merges partial-run coverage with the baseline, then parses the Cobertura XML
  5. Files below their per-file threshold are reported as errors via fshw errors

Configuration

In .fshw.json:

{
  "coverage": {
    "configPath": "coverage-ratchet.json",
    "searchDir": "coverage"
  }
}
Field Type Default Description
configPath string "coverage-ratchet.json" Path to the coverage-ratchet thresholds file (relative to repo root or absolute).
searchDir string "." Directory tree to search for coverage.cobertura.xml files after each test run.

Thresholds are managed by the coverage-ratchet IPC command (or fshw coverage-ratchet). The format is a JSON file maintained by the coverageratchet tool.

CLI

# Check current coverage status
fshw coverage-status

# Update thresholds to match current coverage (ratchet up)
fshw coverage-ratchet

# Show all errors (including coverage violations)
fshw errors

Programmatic usage

daemon.RegisterHandler(
    CoveragePlugin.create
        (System.IO.Path.Combine(repoRoot, "coverage-ratchet.json"))  // configPath
        (System.IO.Path.Combine(repoRoot, "coverage"))               // searchDir
)

Install

dotnet add package FsHotWatch.Coverage
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.7.0-alpha.8 42 5/5/2026
0.7.0-alpha.7 62 4/22/2026
0.7.0-alpha.3 56 4/18/2026
0.7.0-alpha.2 56 4/15/2026
0.6.0-alpha.1 53 4/12/2026
0.5.0-alpha.1 55 4/12/2026
0.3.0-alpha.1 62 4/8/2026
0.1.0-alpha.1 69 4/3/2026