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 =

Returns:

  • (0)
0
EXCEPTION =

Returns:

  • (1)
1
MINIMUM_COVERAGE =

Returns:

  • (2)
2
MAXIMUM_COVERAGE_DROP =

Returns:

  • (3)
3
MAXIMUM_COVERAGE =

Returns:

  • (4)
4
UNITS =

The plural unit each criterion's misses count in, for the checks that report counts rather than percents.

Returns:

  • (Hash[Symbol, String])
{line: "lines", branch: "branches", method: "methods"}.freeze

Class Method Summary collapse

Class Method Details

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.

Parameters:

  • message (String)


23
24
25
26
27
28
# File 'lib/simplecov/exit_codes.rb', line 23

def self.print_error(message)
  $stderr.puts message # rubocop:disable Style/StderrPuts
rescue IOError
  # The violation still has to set the exit status even when its
  # explanation cannot be printed.
end