Module: SimpleCov::ExitCodes
- Defined in:
- lib/simplecov/exit_codes.rb,
lib/simplecov/exit_codes/check.rb,
lib/simplecov/exit_codes/baseline_check.rb,
lib/simplecov/exit_codes/exit_code_handling.rb,
lib/simplecov/exit_codes/maximum_missed_check.rb,
lib/simplecov/exit_codes/maximum_coverage_drop_check.rb,
lib/simplecov/exit_codes/maximum_missed_per_file_check.rb,
lib/simplecov/exit_codes/maximum_overall_coverage_check.rb,
lib/simplecov/exit_codes/minimum_coverage_by_file_check.rb,
lib/simplecov/exit_codes/minimum_overall_coverage_check.rb,
lib/simplecov/exit_codes/minimum_coverage_by_group_check.rb,
sig/simplecov.rbs,
sig/simplecov.rbs
Defined Under Namespace
Modules: ExitCodeHandling, _CoverageLimits Classes: BaselineCheck, Check, MaximumCoverageDropCheck, MaximumMissedCheck, MaximumMissedPerFileCheck, MaximumOverallCoverageCheck, MinimumCoverageByFileCheck, MinimumCoverageByGroupCheck, MinimumOverallCoverageCheck
Constant Summary collapse
- SUCCESS =
0- EXCEPTION =
1- MINIMUM_COVERAGE =
2- MAXIMUM_COVERAGE_DROP =
3- MAXIMUM_COVERAGE =
4- UNITS =
The plural unit each criterion's misses count in, for the checks that report counts rather than percents.
{line: "lines", branch: "branches", method: "methods"}.freeze
Class Method Summary collapse
-
.print_error(message) ⇒ void
Threshold-violation reports and exit-status notices are the output of the enforcement feature, not Ruby warnings: routing them through
Kernel#warnmade-W0swallow the explanation for a failing exit code, letWarning.warnhooks intercept them mid-at_exit, and fed colorized text to warning logs.
Class Method Details
.print_error(message) ⇒ void
This method returns an undefined value.
Threshold-violation reports and exit-status notices are the output of the
enforcement feature, not Ruby warnings: routing them through Kernel#warn
made -W0 swallow the explanation for a failing exit code, let
Warning.warn hooks intercept them mid-at_exit, and fed colorized text to
warning logs. print_errors false remains the intended opt-out.
A parallel runner can close a worker's stderr before its at_exit hooks run, hence the rescue.
23 24 25 26 27 28 |
# File 'lib/simplecov/exit_codes.rb', line 23 def self.print_error() $stderr.puts # rubocop:disable Style/StderrPuts rescue IOError # The violation still has to set the exit status even when its # explanation cannot be printed. end |