Skip to content

Add --changed-files option to report only touched files - #10

Merged
cesarjr merged 1 commit into
mainfrom
add-changed-files-option
Jun 5, 2026
Merged

Add --changed-files option to report only touched files#10
cesarjr merged 1 commit into
mainfrom
add-changed-files-option

Conversation

@cesarjr

@cesarjr cesarjr commented Jun 5, 2026

Copy link
Copy Markdown
Member

Summary

  • Add --changed-files to report the coverage status of a given list of files (for example, a branch's changed files) instead of the project-wide below-100% view.
  • Listed files are shown even when fully covered, so a dev sees the status of everything they touched.
  • The list is read from a file (one repo-relative path per line) or from stdin via -; a leading ./ is stripped so git diff --name-only output joins cleanly.
  • Only files present in both the list and the coverage data are shown. Coverage is still reported per whole file (percentage + missed lines), not isolated to the diff's added lines.
  • Rename the report heading from "Coverage problems" to "Coverage report" (accurate for both the default and the changed-files view).

How to test

  • bundle exec rspec — 24 examples, 0 failures.
  • bundle exec rubocop — no offenses.
  • File list: printf 'app/javascript/routes.jsx\n' > changed.txt && bundle exec exe/couve spec/fixtures/codeclimate.json report.md --changed-files changed.txt — only routes.jsx appears.
  • Stdin: git diff --name-only origin/main...HEAD | bundle exec exe/couve coverage.json report.md --changed-files -.
  • No flag: bundle exec exe/couve spec/fixtures/codeclimate.json report.md — unchanged behavior (all below-100% files).

Notes

  • The default (no-flag) report keeps its existing filter; the only intentional change to it is the heading text.
  • File-level by design: a touched file shows its whole coverage, including pre-existing uncovered lines the dev did not write.

🤖 Generated with Claude Code

Report the coverage status of a given list of files (e.g. a branch's
changed files) instead of the project-wide below-100% view. Listed files
are shown even when fully covered. The list comes from a file (one
repo-relative path per line) or stdin via `-`. Also rename the report
heading from "Coverage problems" to "Coverage report".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cesarjr
cesarjr merged commit 92abdd3 into main Jun 5, 2026
2 checks passed
@cesarjr
cesarjr deleted the add-changed-files-option branch June 5, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant