doctorExitCode function

int doctorExitCode(
  1. List<DoctorCheck> checks, {
  2. bool strict = false,
})

The exit code for checks: 1 when one found a problem, or a note when strict, otherwise 0.

Implementation

int doctorExitCode(List<DoctorCheck> checks, {bool strict = false}) =>
    checks.any(
      (DoctorCheck check) =>
          check.status == DoctorStatus.problem ||
          (strict && check.status == DoctorStatus.note),
    )
    ? 1
    : 0;