mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 21:10:22 +00:00
Remove the lints fatal flag for old dartanalyzer.
Change-Id: I5a1744261e8a6c14393830cb2ede4e54462a6b58 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250775 Commit-Queue: Samuel Rawlins <srawlins@google.com> Reviewed-by: Samuel Rawlins <srawlins@google.com> Auto-Submit: Janice Collins <jcollins@google.com>
This commit is contained in:
parent
9282573e2c
commit
e499586ad6
|
@ -4,7 +4,6 @@
|
|||
|
||||
import 'package:analyzer/error/error.dart';
|
||||
import 'package:analyzer/source/error_processor.dart';
|
||||
import 'package:analyzer/src/error/codes.dart';
|
||||
import 'package:analyzer/src/generated/engine.dart';
|
||||
import 'package:analyzer_cli/src/options.dart';
|
||||
|
||||
|
@ -23,10 +22,6 @@ ErrorSeverity? computeSeverity(
|
|||
return processor.severity;
|
||||
}
|
||||
|
||||
if (commandLineOptions.lintsAreFatal && error.errorCode is LintCode) {
|
||||
return ErrorSeverity.ERROR;
|
||||
}
|
||||
|
||||
return error.errorCode.errorSeverity;
|
||||
}
|
||||
|
||||
|
|
|
@ -116,10 +116,6 @@ class CommandLineOptions {
|
|||
/// Whether to treat info level items as fatal
|
||||
final bool infosAreFatal;
|
||||
|
||||
/// Whether to treat lints as fatal
|
||||
// TODO(devoncarew): Deprecate and remove this flag.
|
||||
final bool lintsAreFatal;
|
||||
|
||||
/// Emit output in a verbose mode.
|
||||
final bool verbose;
|
||||
|
||||
|
@ -154,7 +150,6 @@ class CommandLineOptions {
|
|||
sourceFiles = args.rest,
|
||||
infosAreFatal = cast(args['fatal-infos']) || cast(args['fatal-hints']),
|
||||
warningsAreFatal = cast(args['fatal-warnings']),
|
||||
lintsAreFatal = cast(args['fatal-lints']),
|
||||
trainSnapshot = cast(args['train-snapshot']),
|
||||
verbose = cast(args['verbose']),
|
||||
color = cast(args['color']) {
|
||||
|
|
|
@ -73,7 +73,6 @@ void main() {
|
|||
expect(options.showSdkWarnings, isFalse);
|
||||
expect(options.sourceFiles, equals(['foo.dart']));
|
||||
expect(options.warningsAreFatal, isFalse);
|
||||
expect(options.lintsAreFatal, isFalse);
|
||||
expect(options.trainSnapshot, isFalse);
|
||||
});
|
||||
|
||||
|
@ -262,11 +261,6 @@ void main() {
|
|||
expect(options.sourceFiles, equals(['foo.dart']));
|
||||
});
|
||||
|
||||
test('hintsAreFatal', () {
|
||||
var options = parse(['--dart-sdk', '.', '--fatal-lints', 'foo.dart'])!;
|
||||
expect(options.lintsAreFatal, isTrue);
|
||||
});
|
||||
|
||||
test('bad SDK dir', () {
|
||||
String? failureMessage;
|
||||
parse(['--dart-sdk', '&&&&&', 'foo.dart'],
|
||||
|
|
Loading…
Reference in a new issue