Skip to content

Use the 'cov-loupe' application as a command line utility.

Back to main README

The cov-loupe application provides precise test coverage information for your Ruby application.

It reads the .resultset.json file generated by SimpleCov, and offers multiple ways to analyze and display its information.

Below is the help for version 4.0.0.pre, but run `cov-loupe --help to make sure you get the most up-to-date information.


-------------------------------------------------------------------------------
Usage:      cov-loupe [options] [subcommand] [args]  (default subcommand: list)
Repository: https://github.com/keithrbennett/cov-loupe
Version:    4.0.0.pre
-------------------------------------------------------------------------------

Subcommands:
  detailed <path>          Show per-line rows with hits/covered
  list                     Show files coverage (default: table, or use --format)
  raw <path>               Show the SimpleCov 'lines' array
  summary <path>           Show covered/total/% for a file
  totals                   Show aggregated line totals and average %
  uncovered <path>         Show uncovered lines and a summary
  validate <file>          Evaluate coverage policy from file (exit 0=pass, 1=fail, 2=error)
  validate -e <code>       Evaluate coverage policy from code string
  version                  Show version information

Options:
    -r, --resultset PATH             Path or directory that contains .resultset.json (default: coverage/.resultset.json)
    -R, --root PATH                  Project root (default: .)
    -f, --format FORMAT              Output format: t[able]|j[son]|pretty-json|y[aml]|a[wesome-print] (default: table)
    -o, --sort-order ORDER           Sort order for list: a[scending]|d[escending] (default descending)
    -s, --source MODE                Source display: f[ull]|u[ncovered]
    -c, --context-lines N            Context lines around uncovered lines (non-negative, default: 2)
    -C, --color [BOOLEAN]            Enable/disable ANSI colors for source output (default: true). Accepts: yes/no/y/n/true/false/t/f/on/off/+/-/1/0, or bare -C/--color for true
    -S, --raise-on-stale [BOOLEAN]   Raise error if coverage is stale (default: false). Accepts: yes/no/y/n/true/false/t/f/on/off/+/-/1/0, or bare -S/--raise-on-stale for true
    -g, --tracked-globs x,y,z        Globs for filtering files (list/totals subcommands)
    -h, --help                       Show help
    -l, --log-file PATH              Log file path (default ./cov_loupe.log, use stdout/stderr for streams)
    -F, --force-mode MODE            Force execution mode: cli|mcp|auto (auto = default detection)
        --error-mode MODE            Error handling mode: o[ff]|l[og]|d[ebug] (default log). off (silent), log (log errors to file), debug (verbose with backtraces)
    -v, --version                    Show version information and exit

Examples:
  cov-loupe -r coverage list
  cov-loupe -f json -r coverage summary lib/foo.rb
  cov-loupe -s uncovered -c 2 uncovered lib/foo.rb
  cov-loupe totals -f json

For more detailed help, consult README.md and docs/user/**/*.md
in the installed gem at: /home/kbennett/code/cov-loupe