planOutputWithoutPubAdvice function

String planOutputWithoutPubAdvice(
  1. String output
)

output with pub's upgrade-ADVICE lines dropped (bead pow-gy41).

A Dart Validation Plan opens with dart pub get, and on a seat with an outdated lockfile its advisory block runs past 2000 characters on its own — burying the fatal line, which comes LAST. This is never the failure, so it is never the diagnosis.

Pure and line-wise: every line that is not advice is returned BYTE-IDENTICAL, in order; advice-free input is returned unchanged. Applied BEFORE landReasonTail so the tail budget is spent on signal.

Implementation

String planOutputWithoutPubAdvice(String output) => output
    .split('\n')
    .where(
      (line) =>
          !_pubVersionAdvice.hasMatch(line) &&
          !_pubOutdatedSummary.hasMatch(line),
    )
    .join('\n');