Remove outdated ignores (#162773)
Powered by the new and amazing `unnecessary_ignore` lint. We're not enabling this lint by default because being able to temporarily use ignores that don't ignore anything is a powerful tool to enable migrations. We should turn this lint on locally periodically, though, and clean up all outdated ignores.
This commit is contained in:
committed by
GitHub
parent
5944d992ac
commit
c783ce2344
@@ -1237,7 +1237,6 @@ void main() {
|
||||
try {
|
||||
await createTestCommandRunner(command).run(<String>['run', '--no-pub']);
|
||||
} catch (err) {
|
||||
// ignore: avoid_catches_without_on_clauses
|
||||
fail('Expected no error, got $err');
|
||||
}
|
||||
expect(fakeTerminal.setSingleCharModeHistory, isEmpty);
|
||||
|
||||
@@ -1168,7 +1168,6 @@ void main() {
|
||||
expect(schemeFile.existsSync(), isTrue);
|
||||
expect(schemeFile.readAsStringSync(), contains('FilePath = "/path/to/bundle"'));
|
||||
} catch (err) {
|
||||
// ignore: avoid_catches_without_on_clauses
|
||||
fail(err.toString());
|
||||
} finally {
|
||||
projectDirectory.deleteSync(recursive: true);
|
||||
|
||||
@@ -291,7 +291,6 @@ OS 版本: 10.0.22621 暂缺 Build 22621
|
||||
try {
|
||||
final ProcessResult result = await processLister.getProcessesWithPath();
|
||||
expect(result.stdout, ProcessLister.powershell);
|
||||
// ignore: avoid_catches_without_on_clauses
|
||||
} catch (e) {
|
||||
fail('Unexpected exception: $e');
|
||||
}
|
||||
@@ -312,7 +311,6 @@ OS 版本: 10.0.22621 暂缺 Build 22621
|
||||
try {
|
||||
final ProcessResult result = await processLister.getProcessesWithPath();
|
||||
expect(result.stdout, ProcessLister.pwsh);
|
||||
// ignore: avoid_catches_without_on_clauses
|
||||
} catch (e) {
|
||||
fail('Unexpected exception: $e');
|
||||
}
|
||||
@@ -332,7 +330,6 @@ OS 版本: 10.0.22621 暂缺 Build 22621
|
||||
fail('Should have thrown, but successfully ran ${result.stdout}');
|
||||
} on StateError {
|
||||
// Expected
|
||||
// ignore: avoid_catches_without_on_clauses
|
||||
} catch (e) {
|
||||
fail('Unexpected exception: $e');
|
||||
}
|
||||
|
||||
@@ -150,7 +150,6 @@ Future<void> expectToolExitLater(Future<dynamic> future, Matcher messageMatcher)
|
||||
expect(e.message, messageMatcher);
|
||||
// Catch all exceptions to give a better test failure message.
|
||||
} catch (e, trace) {
|
||||
// ignore: avoid_catches_without_on_clauses
|
||||
fail('ToolExit expected, got $e\n$trace');
|
||||
}
|
||||
}
|
||||
@@ -160,7 +159,6 @@ Future<void> expectReturnsNormallyLater(Future<dynamic> future) async {
|
||||
await future;
|
||||
// Catch all exceptions to give a better test failure message.
|
||||
} catch (e, trace) {
|
||||
// ignore: avoid_catches_without_on_clauses
|
||||
fail('Expected to run with no exceptions, got $e\n$trace');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,7 +127,6 @@ class MemoryIOSink implements IOSink {
|
||||
add(data);
|
||||
// Catches all exceptions to propagate them to the completer.
|
||||
} catch (err, stack) {
|
||||
// ignore: avoid_catches_without_on_clauses
|
||||
sub.cancel();
|
||||
completer.completeError(err, stack);
|
||||
}
|
||||
@@ -201,10 +200,8 @@ class MemoryStdout extends MemoryIOSink implements io.Stdout {
|
||||
bool _hasTerminal = true;
|
||||
|
||||
@override
|
||||
// ignore: override_on_non_overriding_member
|
||||
String get lineTerminator => '\n';
|
||||
@override
|
||||
// ignore: override_on_non_overriding_member
|
||||
set lineTerminator(String value) {
|
||||
throw UnimplementedError('Setting the line terminator is not supported');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user