diff --git a/README.md b/README.md index 5b8ce13cf..29e0133b2 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Usage: pana [] --hosted [] Options: --dart-sdk The directory of the Dart SDK. --flutter-sdk The directory of the Flutter SDK. - --exit-code-threshold The exit code will indicate if (max - granted points) <= threshold. + --exit-code-threshold The exit code will indicate if (max - granted points) > threshold. -j, --json Output log records and full report as JSON. --hosted-url The server that hosts . (defaults to "https://pub.dev") diff --git a/bin/pana.dart b/bin/pana.dart index 52ed6bc25..c7c192e78 100755 --- a/bin/pana.dart +++ b/bin/pana.dart @@ -34,7 +34,7 @@ final _parser = ArgParser() ) ..addOption('exit-code-threshold', help: - 'The exit code will indicate if (max - granted points) <= threshold.') + 'The exit code will indicate if (max - granted points) > threshold.') ..addFlag('json', abbr: 'j', help: 'Output log records and full report as JSON.', @@ -266,8 +266,8 @@ Future main(List args) async { } if (exitCodeThreshold != null && exitCodeThreshold >= 0 && - exitCodeThreshold + summary.report!.grantedPoints < - summary.report!.maxPoints) { + summary.report!.maxPoints - summary.report!.grantedPoints > + exitCodeThreshold) { exitCode = 127; } } catch (e, stack) { diff --git a/test/goldens/help.txt b/test/goldens/help.txt index f2987f71d..d31a07f15 100644 --- a/test/goldens/help.txt +++ b/test/goldens/help.txt @@ -4,7 +4,7 @@ Usage: pana [] --hosted [] Options: --dart-sdk The directory of the Dart SDK. --flutter-sdk The directory of the Flutter SDK. - --exit-code-threshold The exit code will indicate if (max - granted points) <= threshold. + --exit-code-threshold The exit code will indicate if (max - granted points) > threshold. -j, --json Output log records and full report as JSON. --hosted-url The server that hosts . (defaults to "https://pub.dev")