go tool cover and llvm-cov show both print annotated source in the terminal, and it is the fastest way to answer "what is missing in this file" without leaving the shell or forwarding a port off a CI box.
simplecov coverage <path> already resolves a path against SimpleCov.root and prints its totals. simplecov show <path> would print the source itself, with hit counts in the gutter and misses called out:
$ simplecov show lib/simplecov/cli/diff.rb
38 1 def call(baseline)
39 1 rows = compare(current, load(baseline))
40 0 return EXIT_FAILURE if rows.empty?
^ missed
--uncovered-only collapses it to the ranges alone:
$ simplecov show --uncovered-only lib/simplecov/cli/diff.rb
lib/simplecov/cli/diff.rb:40,52-58,71
That second form is worth more than it looks. It is greppable, it fits in a commit message, and it is the right thing to hand a coding agent asked to write the missing tests, which is a workflow a lot of people now have and which the HTML report serves badly. Branch and method misses annotate the same way when those criteria are enabled, and the colors should follow the same NO_COLOR and TTY rules SimpleCov::Color already applies.
go tool coverandllvm-cov showboth print annotated source in the terminal, and it is the fastest way to answer "what is missing in this file" without leaving the shell or forwarding a port off a CI box.simplecov coverage <path>already resolves a path againstSimpleCov.rootand prints its totals.simplecov show <path>would print the source itself, with hit counts in the gutter and misses called out:--uncovered-onlycollapses it to the ranges alone:That second form is worth more than it looks. It is greppable, it fits in a commit message, and it is the right thing to hand a coding agent asked to write the missing tests, which is a workflow a lot of people now have and which the HTML report serves badly. Branch and method misses annotate the same way when those criteria are enabled, and the colors should follow the same
NO_COLORand TTY rulesSimpleCov::Coloralready applies.