Raise GREEN_THRESHOLD to 100 so only fully covered files rate green - #14
Merged
Conversation
) The green rating and the --fail-on-low-coverage gate now require 100% coverage. Ratings and the gate also compare the unrounded percentage, so a file at 99.996% no longer rounds up to 100% and slips through; rounding is kept for display only. Bump version to 0.9.0. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Show every percentage with two decimal places (e.g. 60.00%) and floor instead of rounding, so a partially covered file such as 99.996% shows 99.99% rather than a misleading 100.0% next to a yellow rating. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #13
Summary
Why: a file at 66.66% coverage rated 🟢 and passed the
--fail-on-low-coveragegate, which made the green rating misleading — a file could be marked green with a third of it untested.Parser::GREEN_THRESHOLDfrom66.66to100: 🟢 (andbg-successin the HTML report) now means the file is fully covered, and--fail-on-low-coverageexits1for any reported file below 100%.RED_THRESHOLDis unchanged, so 🟡 now spans 33.34%–99.99%.covered_percentinlow_coverage_files,percentage_indicator, andpercentage_bar_color, so a file at e.g. 99.996% no longer rounds up to 100% and slips past the gate.60.00%), flooring instead of rounding, so a partially covered file never displays as100.00%— a 99.996% file shows99.99%, rates 🟡, and fails the build.lib/couve.rb: the stderr message and--helptext interpolate the constant and now read "below 100%".How to test
bundle exec rspec— 37 examples, 0 failures (developed with strict TDD: every behavior change landed as a failing spec first).bundle exec rubocop— no offenses.bundle exec exe/couve spec/fixtures/codeclimate.json tmp/report.md --fail-on-low-coverage— exits1, printscouve: coverage below 100% in ..., and the report rates the 60.00%/83.33%/93.33% files 🟡.Notes
Behavioral consequence worth knowing: the default (project-wide) report already hides fully covered files, so with this change every reported file is 🔴/🟡 and
--fail-on-low-coveragefails whenever the report is non-empty. In practice the flag pairs with--changed-files, where a fully covered changed-file set still passes; this is now documented in the README. Released as 0.9.0 since it changes the gate behavior for existing users.🤖 Generated with Claude Code