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:
parent
5944d992ac
commit
c783ce2344
@ -223,6 +223,7 @@ linter:
|
|||||||
- unnecessary_constructor_name
|
- unnecessary_constructor_name
|
||||||
# - unnecessary_final # conflicts with prefer_final_locals
|
# - unnecessary_final # conflicts with prefer_final_locals
|
||||||
- unnecessary_getters_setters
|
- unnecessary_getters_setters
|
||||||
|
# - unnecessary_ignore # Disabled by default to simplify migrations; should be periodically enabled locally to clean up offenders
|
||||||
# - unnecessary_lambdas # has false positives: https://github.com/dart-lang/linter/issues/498
|
# - unnecessary_lambdas # has false positives: https://github.com/dart-lang/linter/issues/498
|
||||||
- unnecessary_late
|
- unnecessary_late
|
||||||
- unnecessary_library_directive
|
- unnecessary_library_directive
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
// ignore_for_file: avoid_dynamic_calls
|
|
||||||
|
|
||||||
import 'package:a11y_assessments/main.dart';
|
import 'package:a11y_assessments/main.dart';
|
||||||
import 'package:a11y_assessments/use_cases/action_chip.dart';
|
import 'package:a11y_assessments/use_cases/action_chip.dart';
|
||||||
import 'package:a11y_assessments/use_cases/auto_complete.dart';
|
import 'package:a11y_assessments/use_cases/auto_complete.dart';
|
||||||
|
@ -437,7 +437,6 @@ class ModuleTest {
|
|||||||
Future<void> main() async {
|
Future<void> main() async {
|
||||||
await task(
|
await task(
|
||||||
combine(<TaskFunction>[
|
combine(<TaskFunction>[
|
||||||
// ignore: avoid_redundant_argument_values
|
|
||||||
ModuleTest(gradleVersion: '8.4').call,
|
ModuleTest(gradleVersion: '8.4').call,
|
||||||
ModuleTest(gradleVersion: '8.4-rc-3').call,
|
ModuleTest(gradleVersion: '8.4-rc-3').call,
|
||||||
]),
|
]),
|
||||||
|
@ -407,10 +407,5 @@ class ModuleTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> main() async {
|
Future<void> main() async {
|
||||||
await task(
|
await task(combine(<TaskFunction>[ModuleTest(gradleVersion: '8.7').call]));
|
||||||
combine(<TaskFunction>[
|
|
||||||
// ignore: avoid_redundant_argument_values
|
|
||||||
ModuleTest(gradleVersion: '8.7').call,
|
|
||||||
]),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
// ignore_for_file: avoid_print
|
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
@ -2,10 +2,6 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
// ignore_for_file: always_specify_types
|
|
||||||
// ignore_for_file: camel_case_types
|
|
||||||
// ignore_for_file: non_constant_identifier_names
|
|
||||||
|
|
||||||
// AUTO GENERATED FILE, DO NOT EDIT.
|
// AUTO GENERATED FILE, DO NOT EDIT.
|
||||||
//
|
//
|
||||||
// Generated by `package:ffigen`.
|
// Generated by `package:ffigen`.
|
||||||
|
@ -1036,11 +1036,7 @@ class Demos {
|
|||||||
description: localizations.demoCupertinoPickerDescription,
|
description: localizations.demoCupertinoPickerDescription,
|
||||||
documentationUrl: '$_docsBaseUrl/cupertino/CupertinoDatePicker-class.html',
|
documentationUrl: '$_docsBaseUrl/cupertino/CupertinoDatePicker-class.html',
|
||||||
buildRoute:
|
buildRoute:
|
||||||
(_) => DeferredWidget(
|
(_) => DeferredWidget(cupertinoLoader, () => cupertino_demos.CupertinoPickerDemo()),
|
||||||
cupertinoLoader,
|
|
||||||
// ignore: prefer_const_constructors
|
|
||||||
() => cupertino_demos.CupertinoPickerDemo(),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
category: GalleryDemoCategory.cupertino,
|
category: GalleryDemoCategory.cupertino,
|
||||||
@ -1056,11 +1052,8 @@ class Demos {
|
|||||||
description: localizations.demoCupertinoScrollbarDescription,
|
description: localizations.demoCupertinoScrollbarDescription,
|
||||||
documentationUrl: '$_docsBaseUrl/cupertino/CupertinoScrollbar-class.html',
|
documentationUrl: '$_docsBaseUrl/cupertino/CupertinoScrollbar-class.html',
|
||||||
buildRoute:
|
buildRoute:
|
||||||
(_) => DeferredWidget(
|
(_) =>
|
||||||
cupertinoLoader,
|
DeferredWidget(cupertinoLoader, () => cupertino_demos.CupertinoScrollbarDemo()),
|
||||||
// ignore: prefer_const_constructors
|
|
||||||
() => cupertino_demos.CupertinoScrollbarDemo(),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
category: GalleryDemoCategory.cupertino,
|
category: GalleryDemoCategory.cupertino,
|
||||||
|
@ -55,28 +55,20 @@ class RouteConfiguration {
|
|||||||
),
|
),
|
||||||
Path(
|
Path(
|
||||||
r'^' + rally_routes.homeRoute,
|
r'^' + rally_routes.homeRoute,
|
||||||
(BuildContext context, String? match) => StudyWrapper(
|
(BuildContext context, String? match) =>
|
||||||
study: DeferredWidget(
|
StudyWrapper(study: DeferredWidget(rally.loadLibrary, () => rally.RallyApp())),
|
||||||
rally.loadLibrary,
|
|
||||||
() => rally.RallyApp(),
|
|
||||||
), // ignore: prefer_const_constructors
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Path(
|
Path(
|
||||||
r'^' + shrine_routes.homeRoute,
|
r'^' + shrine_routes.homeRoute,
|
||||||
(BuildContext context, String? match) => StudyWrapper(
|
(BuildContext context, String? match) =>
|
||||||
study: DeferredWidget(
|
StudyWrapper(study: DeferredWidget(shrine.loadLibrary, () => shrine.ShrineApp())),
|
||||||
shrine.loadLibrary,
|
|
||||||
() => shrine.ShrineApp(),
|
|
||||||
), // ignore: prefer_const_constructors
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Path(
|
Path(
|
||||||
r'^' + crane_routes.defaultRoute,
|
r'^' + crane_routes.defaultRoute,
|
||||||
(BuildContext context, String? match) => StudyWrapper(
|
(BuildContext context, String? match) => StudyWrapper(
|
||||||
study: DeferredWidget(
|
study: DeferredWidget(
|
||||||
crane.loadLibrary,
|
crane.loadLibrary,
|
||||||
() => crane.CraneApp(), // ignore: prefer_const_constructors
|
() => crane.CraneApp(),
|
||||||
placeholder: const DeferredLoadingPlaceholder(name: 'Crane'),
|
placeholder: const DeferredLoadingPlaceholder(name: 'Crane'),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -84,16 +76,11 @@ class RouteConfiguration {
|
|||||||
Path(
|
Path(
|
||||||
r'^' + fortnightly_routes.defaultRoute,
|
r'^' + fortnightly_routes.defaultRoute,
|
||||||
(BuildContext context, String? match) => StudyWrapper(
|
(BuildContext context, String? match) => StudyWrapper(
|
||||||
study: DeferredWidget(
|
study: DeferredWidget(fortnightly.loadLibrary, () => fortnightly.FortnightlyApp()),
|
||||||
fortnightly.loadLibrary,
|
|
||||||
// ignore: prefer_const_constructors
|
|
||||||
() => fortnightly.FortnightlyApp(),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Path(
|
Path(
|
||||||
r'^' + reply_routes.homeRoute,
|
r'^' + reply_routes.homeRoute,
|
||||||
// ignore: prefer_const_constructors
|
|
||||||
(BuildContext context, String? match) =>
|
(BuildContext context, String? match) =>
|
||||||
const StudyWrapper(study: reply.ReplyApp(), hasBottomNavBar: true),
|
const StudyWrapper(study: reply.ReplyApp(), hasBottomNavBar: true),
|
||||||
),
|
),
|
||||||
|
@ -263,7 +263,6 @@ SampleStats getSampleStats(SourceElement element) {
|
|||||||
|
|
||||||
/// Exit the app with a message to stderr.
|
/// Exit the app with a message to stderr.
|
||||||
/// Can be overridden by tests to avoid exits.
|
/// Can be overridden by tests to avoid exits.
|
||||||
// ignore: prefer_function_declarations_over_variables
|
|
||||||
void Function(String message) errorExit = (String message) {
|
void Function(String message) errorExit = (String message) {
|
||||||
io.stderr.writeln(message);
|
io.stderr.writeln(message);
|
||||||
io.exit(1);
|
io.exit(1);
|
||||||
|
@ -357,7 +357,7 @@ class Size extends OffsetBase {
|
|||||||
///
|
///
|
||||||
/// * [Size.fromRadius], which is more convenient when the available size
|
/// * [Size.fromRadius], which is more convenient when the available size
|
||||||
/// is the radius of a circle.
|
/// is the radius of a circle.
|
||||||
const Size.square(double dimension) : super(dimension, dimension); // ignore: use_super_parameters
|
const Size.square(double dimension) : super(dimension, dimension);
|
||||||
|
|
||||||
/// Creates a [Size] with the given [width] and an infinite [height].
|
/// Creates a [Size] with the given [width] and an infinite [height].
|
||||||
const Size.fromWidth(double width) : super(width, double.infinity);
|
const Size.fromWidth(double width) : super(width, double.infinity);
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
part of dart.ui;
|
part of dart.ui;
|
||||||
|
|
||||||
// ignore_for_file: avoid_classes_with_only_static_members
|
|
||||||
|
|
||||||
/// Helper functions for Dart Plugin Registrants.
|
/// Helper functions for Dart Plugin Registrants.
|
||||||
abstract final class DartPluginRegistrant {
|
abstract final class DartPluginRegistrant {
|
||||||
static bool _wasInitialized = false;
|
static bool _wasInitialized = false;
|
||||||
|
@ -7,8 +7,7 @@ import 'dart:io';
|
|||||||
|
|
||||||
import 'package:path/path.dart' as path;
|
import 'package:path/path.dart' as path;
|
||||||
import 'package:test_api/backend.dart';
|
import 'package:test_api/backend.dart';
|
||||||
// TODO(ditman): Fix ignore when https://github.com/flutter/flutter/issues/143599 is resolved.
|
import 'package:test_core/src/util/io.dart';
|
||||||
import 'package:test_core/src/util/io.dart'; // ignore: implementation_imports
|
|
||||||
|
|
||||||
import 'browser.dart';
|
import 'browser.dart';
|
||||||
import 'browser_process.dart';
|
import 'browser_process.dart';
|
||||||
|
@ -10,10 +10,8 @@ import 'package:path/path.dart' as pathlib;
|
|||||||
// https://github.com/dart-lang/test/issues/1521
|
// https://github.com/dart-lang/test/issues/1521
|
||||||
import 'package:skia_gold_client/skia_gold_client.dart';
|
import 'package:skia_gold_client/skia_gold_client.dart';
|
||||||
import 'package:test_api/backend.dart' as hack;
|
import 'package:test_api/backend.dart' as hack;
|
||||||
// TODO(ditman): Fix ignores when https://github.com/flutter/flutter/issues/143599 is resolved.
|
import 'package:test_core/src/executable.dart' as test;
|
||||||
import 'package:test_core/src/executable.dart' as test; // ignore: implementation_imports
|
import 'package:test_core/src/runner/hack_register_platform.dart' as hack;
|
||||||
import 'package:test_core/src/runner/hack_register_platform.dart'
|
|
||||||
as hack; // ignore: implementation_imports
|
|
||||||
|
|
||||||
import '../browser.dart';
|
import '../browser.dart';
|
||||||
import '../common.dart';
|
import '../common.dart';
|
||||||
|
@ -23,13 +23,12 @@ import 'package:skia_gold_client/skia_gold_client.dart';
|
|||||||
import 'package:stream_channel/stream_channel.dart';
|
import 'package:stream_channel/stream_channel.dart';
|
||||||
|
|
||||||
import 'package:test_core/backend.dart' hide Compiler;
|
import 'package:test_core/backend.dart' hide Compiler;
|
||||||
// TODO(ditman): Fix ignores when https://github.com/flutter/flutter/issues/143599 is resolved.
|
import 'package:test_core/src/runner/environment.dart';
|
||||||
import 'package:test_core/src/runner/environment.dart'; // ignore: implementation_imports
|
import 'package:test_core/src/runner/platform.dart';
|
||||||
import 'package:test_core/src/runner/platform.dart'; // ignore: implementation_imports
|
import 'package:test_core/src/runner/plugin/platform_helpers.dart';
|
||||||
import 'package:test_core/src/runner/plugin/platform_helpers.dart'; // ignore: implementation_imports
|
import 'package:test_core/src/runner/runner_suite.dart';
|
||||||
import 'package:test_core/src/runner/runner_suite.dart'; // ignore: implementation_imports
|
import 'package:test_core/src/util/io.dart';
|
||||||
import 'package:test_core/src/util/io.dart'; // ignore: implementation_imports
|
import 'package:test_core/src/util/stack_trace_mapper.dart';
|
||||||
import 'package:test_core/src/util/stack_trace_mapper.dart'; // ignore: implementation_imports
|
|
||||||
|
|
||||||
import 'package:web_socket_channel/web_socket_channel.dart';
|
import 'package:web_socket_channel/web_socket_channel.dart';
|
||||||
import 'package:web_test_utils/image_compare.dart';
|
import 'package:web_test_utils/image_compare.dart';
|
||||||
|
@ -90,7 +90,7 @@ class Size extends OffsetBase {
|
|||||||
const Size(super.width, super.height);
|
const Size(super.width, super.height);
|
||||||
// Used by the rendering library's _DebugSize hack.
|
// Used by the rendering library's _DebugSize hack.
|
||||||
Size.copy(Size source) : super(source.width, source.height);
|
Size.copy(Size source) : super(source.width, source.height);
|
||||||
const Size.square(double dimension) : super(dimension, dimension); // ignore: use_super_parameters
|
const Size.square(double dimension) : super(dimension, dimension);
|
||||||
const Size.fromWidth(double width) : super(width, double.infinity);
|
const Size.fromWidth(double width) : super(width, double.infinity);
|
||||||
const Size.fromHeight(double height) : super(double.infinity, height);
|
const Size.fromHeight(double height) : super(double.infinity, height);
|
||||||
const Size.fromRadius(double radius) : super(radius * 2.0, radius * 2.0);
|
const Size.fromRadius(double radius) : super(radius * 2.0, radius * 2.0);
|
||||||
|
@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
part of ui;
|
part of ui;
|
||||||
|
|
||||||
// ignore_for_file: avoid_classes_with_only_static_members
|
|
||||||
|
|
||||||
/// Helper functions for Dart Plugin Registrants.
|
/// Helper functions for Dart Plugin Registrants.
|
||||||
class DartPluginRegistrant {
|
class DartPluginRegistrant {
|
||||||
/// Makes sure the that the Dart Plugin Registrant has been called for this
|
/// Makes sure the that the Dart Plugin Registrant has been called for this
|
||||||
|
@ -16,7 +16,6 @@ typedef PlatformMessageCallback =
|
|||||||
void Function(String name, ByteData? data, PlatformMessageResponseCallback? callback);
|
void Function(String name, ByteData? data, PlatformMessageResponseCallback? callback);
|
||||||
typedef ErrorCallback = bool Function(Object exception, StackTrace stackTrace);
|
typedef ErrorCallback = bool Function(Object exception, StackTrace stackTrace);
|
||||||
|
|
||||||
// ignore: avoid_classes_with_only_static_members
|
|
||||||
/// A token that represents a root isolate.
|
/// A token that represents a root isolate.
|
||||||
class RootIsolateToken {
|
class RootIsolateToken {
|
||||||
static RootIsolateToken? get instance {
|
static RootIsolateToken? get instance {
|
||||||
|
@ -2756,30 +2756,16 @@ extension SkTextStylePropertiesExtension on SkTextStyleProperties {
|
|||||||
|
|
||||||
@JS('shadows')
|
@JS('shadows')
|
||||||
external set _shadows(JSArray<JSAny?>? value);
|
external set _shadows(JSArray<JSAny?>? value);
|
||||||
set shadows(List<SkTextShadow>? value) =>
|
set shadows(List<SkTextShadow>? value) => _shadows = (value as List<JSAny>?)?.toJS;
|
||||||
// TODO(joshualitt): remove this cast when we reify JS types on JS
|
|
||||||
// backends.
|
|
||||||
// ignore: unnecessary_cast
|
|
||||||
_shadows =
|
|
||||||
(value as List<JSAny>?)?.toJS;
|
|
||||||
|
|
||||||
@JS('fontFeatures')
|
@JS('fontFeatures')
|
||||||
external set _fontFeatures(JSArray<JSAny?>? value);
|
external set _fontFeatures(JSArray<JSAny?>? value);
|
||||||
set fontFeatures(List<SkFontFeature>? value) =>
|
set fontFeatures(List<SkFontFeature>? value) => _fontFeatures = (value as List<JSAny>?)?.toJS;
|
||||||
// TODO(joshualitt): remove this cast when we reify JS types on JS
|
|
||||||
// backends.
|
|
||||||
// ignore: unnecessary_cast
|
|
||||||
_fontFeatures =
|
|
||||||
(value as List<JSAny>?)?.toJS;
|
|
||||||
|
|
||||||
@JS('fontVariations')
|
@JS('fontVariations')
|
||||||
external set _fontVariations(JSArray<JSAny?>? value);
|
external set _fontVariations(JSArray<JSAny?>? value);
|
||||||
set fontVariations(List<SkFontVariation>? value) =>
|
set fontVariations(List<SkFontVariation>? value) =>
|
||||||
// TODO(joshualitt): remove this cast when we reify JS types on JS
|
_fontVariations = (value as List<JSAny>?)?.toJS;
|
||||||
// backends.
|
|
||||||
// ignore: unnecessary_cast
|
|
||||||
_fontVariations =
|
|
||||||
(value as List<JSAny>?)?.toJS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@JS()
|
@JS()
|
||||||
|
@ -158,7 +158,6 @@ extension DomWindowExtension on DomWindow {
|
|||||||
message.toJSAnyShallow,
|
message.toJSAnyShallow,
|
||||||
targetOrigin.toJS,
|
targetOrigin.toJS,
|
||||||
// Cast is necessary so we can call `.toJS` on the right extension.
|
// Cast is necessary so we can call `.toJS` on the right extension.
|
||||||
// ignore: unnecessary_cast
|
|
||||||
(messagePorts as List<JSAny>).toJS,
|
(messagePorts as List<JSAny>).toJS,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -140,8 +140,7 @@ class HtmlRenderer implements Renderer {
|
|||||||
required ui.ImageFilter outer,
|
required ui.ImageFilter outer,
|
||||||
required ui.ImageFilter inner,
|
required ui.ImageFilter inner,
|
||||||
}) {
|
}) {
|
||||||
// TODO(ferhat): add implementation and remove the "ignore".
|
// TODO(ferhat): add implementation.
|
||||||
// ignore: avoid_unused_constructor_parameters
|
|
||||||
throw UnimplementedError('ImageFilter.erode not implemented for HTML renderer.');
|
throw UnimplementedError('ImageFilter.erode not implemented for HTML renderer.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -869,7 +869,6 @@ class GlContext {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore: avoid_classes_with_only_static_members
|
|
||||||
/// Creates gl context from cached OffscreenCanvas for webgl rendering to image.
|
/// Creates gl context from cached OffscreenCanvas for webgl rendering to image.
|
||||||
class GlContextCache {
|
class GlContextCache {
|
||||||
static int _maxPixelWidth = 0;
|
static int _maxPixelWidth = 0;
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
@DefaultAsset('skwasm')
|
@DefaultAsset('skwasm')
|
||||||
// The web_sdk/sdk_rewriter.dart uses this directive.
|
// The web_sdk/sdk_rewriter.dart uses this directive.
|
||||||
// ignore: unnecessary_library_directive
|
|
||||||
library skwasm_impl;
|
library skwasm_impl;
|
||||||
|
|
||||||
import 'dart:ffi';
|
import 'dart:ffi';
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
// ignore_for_file: avoid_unused_constructor_parameters
|
|
||||||
|
|
||||||
import 'dart:ffi';
|
import 'dart:ffi';
|
||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
|
|
||||||
|
@ -74,9 +74,7 @@ class CustomElementDimensionsProvider extends DimensionsProvider {
|
|||||||
void close() {
|
void close() {
|
||||||
super.close();
|
super.close();
|
||||||
_hostElementResizeObserver?.disconnect();
|
_hostElementResizeObserver?.disconnect();
|
||||||
// ignore:unawaited_futures
|
|
||||||
_dprChangeStreamSubscription?.cancel();
|
_dprChangeStreamSubscription?.cancel();
|
||||||
// ignore:unawaited_futures
|
|
||||||
_onResizeStreamController.close();
|
_onResizeStreamController.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,6 @@ class FullPageDimensionsProvider extends DimensionsProvider {
|
|||||||
void close() {
|
void close() {
|
||||||
super.close();
|
super.close();
|
||||||
_domResizeSubscription.cancel();
|
_domResizeSubscription.cancel();
|
||||||
// ignore:unawaited_futures
|
|
||||||
_onResizeStreamController.close();
|
_onResizeStreamController.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ double _rectDistance(Rect a, Rect b) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
double _sizeDistance(Size a, Size b) {
|
double _sizeDistance(Size a, Size b) {
|
||||||
final Offset delta = (b - a) as Offset; // ignore: unnecessary_parenthesis
|
final Offset delta = (b - a) as Offset;
|
||||||
return delta.distance;
|
return delta.distance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,7 +191,7 @@ void testMain() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void twoCallback(ByteData? responseData) {
|
void twoCallback(ByteData? responseData) {
|
||||||
throw TestFailure('wrong callback called'); // ignore: only_throw_errors
|
throw TestFailure('wrong callback called');
|
||||||
}
|
}
|
||||||
|
|
||||||
_resize(buffers, channel, 100);
|
_resize(buffers, channel, 100);
|
||||||
@ -214,7 +214,7 @@ void testMain() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void twoCallback(ByteData? responseData) {
|
void twoCallback(ByteData? responseData) {
|
||||||
throw TestFailure('wrong callback called'); // ignore: only_throw_errors
|
throw TestFailure('wrong callback called');
|
||||||
}
|
}
|
||||||
|
|
||||||
_resize(buffers, channel, 1);
|
_resize(buffers, channel, 1);
|
||||||
|
@ -46,7 +46,7 @@ Future<void> testMain() async {
|
|||||||
} on TestFailure {
|
} on TestFailure {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
throw TestFailure('transforms were too close to equal'); // ignore: only_throw_errors
|
throw TestFailure('transforms were too close to equal');
|
||||||
}
|
}
|
||||||
|
|
||||||
test('ui.Canvas.translate affects canvas.getTransform', () {
|
test('ui.Canvas.translate affects canvas.getTransform', () {
|
||||||
@ -136,7 +136,7 @@ Future<void> testMain() async {
|
|||||||
} on TestFailure {
|
} on TestFailure {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
throw TestFailure('transforms were too close to equal'); // ignore: only_throw_errors
|
throw TestFailure('transforms were too close to equal');
|
||||||
}
|
}
|
||||||
|
|
||||||
group('ui.Canvas clip tests', () {
|
group('ui.Canvas clip tests', () {
|
||||||
|
@ -159,7 +159,6 @@ void main() async {
|
|||||||
|
|
||||||
List<ColorFilter> colorFilters() {
|
List<ColorFilter> colorFilters() {
|
||||||
// Create new color filter instances on each invocation.
|
// Create new color filter instances on each invocation.
|
||||||
// ignore: prefer_const_constructors
|
|
||||||
return <ColorFilter>[
|
return <ColorFilter>[
|
||||||
ColorFilter.mode(green, BlendMode.color), // ignore: prefer_const_constructors
|
ColorFilter.mode(green, BlendMode.color), // ignore: prefer_const_constructors
|
||||||
ColorFilter.mode(red, BlendMode.color), // ignore: prefer_const_constructors
|
ColorFilter.mode(red, BlendMode.color), // ignore: prefer_const_constructors
|
||||||
|
@ -75,5 +75,5 @@ void main() {
|
|||||||
final Pointer<Utf8> fakePath = 'fake-path'.toNativeUtf8();
|
final Pointer<Utf8> fakePath = 'fake-path'.toNativeUtf8();
|
||||||
expect(_loadLibraryFromKernel(fakePath), null);
|
expect(_loadLibraryFromKernel(fakePath), null);
|
||||||
malloc.free(fakePath);
|
malloc.free(fakePath);
|
||||||
}, skip: kProfileMode || kReleaseMode); // ignore: avoid_redundant_argument_values
|
}, skip: kProfileMode || kReleaseMode);
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
// ignore_for_file: prefer_const_constructors, unused_local_variable, depend_on_referenced_packages
|
// ignore_for_file: prefer_const_constructors, unused_local_variable
|
||||||
import 'dart:core';
|
import 'dart:core';
|
||||||
|
|
||||||
import 'package:const_finder_fixtures_package/package.dart';
|
import 'package:const_finder_fixtures_package/package.dart';
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
// ignore_for_file: prefer_const_constructors, unused_local_variable, depend_on_referenced_packages
|
// ignore_for_file: prefer_const_constructors, unused_local_variable
|
||||||
import 'dart:core';
|
import 'dart:core';
|
||||||
|
|
||||||
import 'package:const_finder_fixtures_package/package.dart';
|
import 'package:const_finder_fixtures_package/package.dart';
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
// ignore_for_file: prefer_const_constructors, depend_on_referenced_packages
|
// ignore_for_file: prefer_const_constructors
|
||||||
import 'package:const_finder_fixtures/target.dart';
|
import 'package:const_finder_fixtures/target.dart';
|
||||||
|
|
||||||
void createTargetInPackage() {
|
void createTargetInPackage() {
|
||||||
|
@ -11,8 +11,6 @@
|
|||||||
// this script (the first set for _canonicalizeLanguageCode and the second set
|
// this script (the first set for _canonicalizeLanguageCode and the second set
|
||||||
// for _canonicalizeRegionCode).
|
// for _canonicalizeRegionCode).
|
||||||
|
|
||||||
// ignore_for_file: avoid_print
|
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
@ -1163,8 +1163,6 @@ class CupertinoDynamicColor with Diagnosticable implements Color {
|
|||||||
int get value => _effectiveColor.value;
|
int get value => _effectiveColor.value;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
// TODO(matanl): Remove once https://github.com/flutter/engine/pull/56329 lands in the framework.
|
|
||||||
// ignore: override_on_non_overriding_member, public_member_api_docs
|
|
||||||
int toARGB32() => value;
|
int toARGB32() => value;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -171,10 +171,6 @@ class AutomaticNotchedShape extends NotchedShape {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Path getOuterPath(Rect hostRect, Rect? guestRect) {
|
Path getOuterPath(Rect hostRect, Rect? guestRect) {
|
||||||
// ignore: avoid_renaming_method_parameters
|
|
||||||
// The parameters of this method are renamed over the baseclass because they
|
|
||||||
// would clash with properties of this object, and the use of all four of
|
|
||||||
// them in the code below is really confusing if they have the same names.
|
|
||||||
final Path hostPath = host.getOuterPath(hostRect);
|
final Path hostPath = host.getOuterPath(hostRect);
|
||||||
if (guest != null && guestRect != null) {
|
if (guest != null && guestRect != null) {
|
||||||
final Path guestPath = guest!.getOuterPath(guestRect);
|
final Path guestPath = guest!.getOuterPath(guestRect);
|
||||||
|
@ -34,9 +34,9 @@ export 'package:flutter/foundation.dart'
|
|||||||
visibleForTesting;
|
visibleForTesting;
|
||||||
export 'package:flutter/foundation.dart'
|
export 'package:flutter/foundation.dart'
|
||||||
show ErrorDescription, ErrorHint, ErrorSummary, FlutterError, debugPrint, debugPrintStack;
|
show ErrorDescription, ErrorHint, ErrorSummary, FlutterError, debugPrint, debugPrintStack;
|
||||||
export 'package:flutter/foundation.dart' show ValueChanged, ValueGetter, ValueSetter, VoidCallback;
|
|
||||||
export 'package:flutter/foundation.dart' show DiagnosticLevel, DiagnosticsNode;
|
export 'package:flutter/foundation.dart' show DiagnosticLevel, DiagnosticsNode;
|
||||||
export 'package:flutter/foundation.dart' show Key, LocalKey, ValueKey;
|
export 'package:flutter/foundation.dart' show Key, LocalKey, ValueKey;
|
||||||
|
export 'package:flutter/foundation.dart' show ValueChanged, ValueGetter, ValueSetter, VoidCallback;
|
||||||
export 'package:flutter/rendering.dart'
|
export 'package:flutter/rendering.dart'
|
||||||
show RenderBox, RenderObject, debugDumpLayerTree, debugDumpRenderTree;
|
show RenderBox, RenderObject, debugDumpLayerTree, debugDumpRenderTree;
|
||||||
|
|
||||||
@ -6947,7 +6947,6 @@ mixin RootElementMixin on Element {
|
|||||||
/// to [runApp]. The binding is responsible for driving the build pipeline by
|
/// to [runApp]. The binding is responsible for driving the build pipeline by
|
||||||
/// calling the build owner's [BuildOwner.buildScope] method. See
|
/// calling the build owner's [BuildOwner.buildScope] method. See
|
||||||
/// [WidgetsBinding.drawFrame].
|
/// [WidgetsBinding.drawFrame].
|
||||||
// ignore: use_setters_to_change_properties, (API predates enforcing the lint)
|
|
||||||
void assignOwner(BuildOwner owner) {
|
void assignOwner(BuildOwner owner) {
|
||||||
_owner = owner;
|
_owner = owner;
|
||||||
_parentBuildScope = BuildScope();
|
_parentBuildScope = BuildScope();
|
||||||
|
@ -3748,10 +3748,7 @@ class _Location {
|
|||||||
required this.file,
|
required this.file,
|
||||||
required this.line,
|
required this.line,
|
||||||
required this.column,
|
required this.column,
|
||||||
// TODO(srawlins): `unused_element_parameter` is being separated from
|
this.name, // ignore: unused_element_parameter
|
||||||
// `unused_element`. Ignore both names until the separation is complete.
|
|
||||||
// ignore: unused_element, unused_element_parameter
|
|
||||||
this.name,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/// File path of the location.
|
/// File path of the location.
|
||||||
|
@ -188,7 +188,6 @@ void main() {
|
|||||||
FlutterError.onError = oldHandler;
|
FlutterError.onError = oldHandler;
|
||||||
|
|
||||||
expect(exceptions.length, 1);
|
expect(exceptions.length, 1);
|
||||||
// ignore: avoid_dynamic_calls
|
|
||||||
expect(exceptions.single.runtimeType, FlutterError);
|
expect(exceptions.single.runtimeType, FlutterError);
|
||||||
final FlutterError error = exceptions.first as FlutterError;
|
final FlutterError error = exceptions.first as FlutterError;
|
||||||
expect(error.diagnostics.length, 5);
|
expect(error.diagnostics.length, 5);
|
||||||
|
@ -2475,7 +2475,6 @@ void main() {
|
|||||||
FlutterError.onError = oldHandler;
|
FlutterError.onError = oldHandler;
|
||||||
|
|
||||||
expect(exceptions.length, 1);
|
expect(exceptions.length, 1);
|
||||||
// ignore: avoid_dynamic_calls
|
|
||||||
expect(exceptions.single.runtimeType, FlutterError);
|
expect(exceptions.single.runtimeType, FlutterError);
|
||||||
final FlutterError error = exceptions.first as FlutterError;
|
final FlutterError error = exceptions.first as FlutterError;
|
||||||
expect(error.diagnostics.length, 5);
|
expect(error.diagnostics.length, 5);
|
||||||
|
@ -645,10 +645,7 @@ void main() {
|
|||||||
RenderObject render = tester.renderObject(
|
RenderObject render = tester.renderObject(
|
||||||
find.byWidgetPredicate((Widget w) => '${w.runtimeType}' == '_DayPeriodInputPadding'),
|
find.byWidgetPredicate((Widget w) => '${w.runtimeType}' == '_DayPeriodInputPadding'),
|
||||||
);
|
);
|
||||||
expect(
|
expect((render as dynamic).orientation, Orientation.portrait);
|
||||||
(render as dynamic).orientation,
|
|
||||||
Orientation.portrait,
|
|
||||||
); // ignore: avoid_dynamic_calls
|
|
||||||
|
|
||||||
// landscape
|
// landscape
|
||||||
tester.view.physicalSize = const Size(800.5, 800);
|
tester.view.physicalSize = const Size(800.5, 800);
|
||||||
|
@ -391,7 +391,6 @@ class TestPlatformDispatcher implements PlatformDispatcher {
|
|||||||
bool get supportsShowingSystemContextMenu =>
|
bool get supportsShowingSystemContextMenu =>
|
||||||
_supportsShowingSystemContextMenu ?? _platformDispatcher.supportsShowingSystemContextMenu;
|
_supportsShowingSystemContextMenu ?? _platformDispatcher.supportsShowingSystemContextMenu;
|
||||||
bool? _supportsShowingSystemContextMenu;
|
bool? _supportsShowingSystemContextMenu;
|
||||||
// ignore: avoid_setters_without_getters
|
|
||||||
set supportsShowingSystemContextMenu(bool value) {
|
set supportsShowingSystemContextMenu(bool value) {
|
||||||
_supportsShowingSystemContextMenu = value;
|
_supportsShowingSystemContextMenu = value;
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ import 'package:flutter/scheduler.dart';
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:matcher/expect.dart' as matcher;
|
import 'package:matcher/expect.dart' as matcher;
|
||||||
import 'package:matcher/src/expect/async_matcher.dart'; // ignore: implementation_imports
|
import 'package:matcher/src/expect/async_matcher.dart';
|
||||||
|
|
||||||
import 'multi_view_testing.dart';
|
import 'multi_view_testing.dart';
|
||||||
|
|
||||||
|
@ -326,7 +326,6 @@ class ErrorHandlingFile extends ForwardingFileSystemEntity<File, io.File> with F
|
|||||||
bytes += chunkLength;
|
bytes += chunkLength;
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// ignore: avoid_catches_without_on_clauses, rethrows
|
|
||||||
ErrorHandlingFileSystem.deleteIfExists(resultFile, recursive: true);
|
ErrorHandlingFileSystem.deleteIfExists(resultFile, recursive: true);
|
||||||
rethrow;
|
rethrow;
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -667,7 +667,6 @@ Future<int> exitWithHooks(int code, {required ShutdownHooks shutdownHooks}) asyn
|
|||||||
// This catches all exceptions because the error is propagated on the
|
// This catches all exceptions because the error is propagated on the
|
||||||
// completer.
|
// completer.
|
||||||
} catch (error, stackTrace) {
|
} catch (error, stackTrace) {
|
||||||
// ignore: avoid_catches_without_on_clauses
|
|
||||||
completer.completeError(error, stackTrace);
|
completer.completeError(error, stackTrace);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -89,7 +89,6 @@ class _TaskQueueItem<T> {
|
|||||||
try {
|
try {
|
||||||
_completer.complete(await _closure());
|
_completer.complete(await _closure());
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// ignore: avoid_catches_without_on_clauses, forwards to Future
|
|
||||||
_completer.completeError(e);
|
_completer.completeError(e);
|
||||||
} finally {
|
} finally {
|
||||||
onComplete?.call();
|
onComplete?.call();
|
||||||
|
@ -629,7 +629,6 @@ class ReleaseIosApplicationBundle extends _IosAssetBundleWithDSYM {
|
|||||||
try {
|
try {
|
||||||
await super.build(environment);
|
await super.build(environment);
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
// ignore: avoid_catches_without_on_clauses
|
|
||||||
buildSuccess = false;
|
buildSuccess = false;
|
||||||
rethrow;
|
rethrow;
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -706,7 +706,6 @@ class ReleaseMacOSBundleFlutterAssets extends MacOSBundleFlutterAssets {
|
|||||||
try {
|
try {
|
||||||
await super.build(environment);
|
await super.build(environment);
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
// ignore: avoid_catches_without_on_clauses
|
|
||||||
buildSuccess = false;
|
buildSuccess = false;
|
||||||
rethrow;
|
rethrow;
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -357,7 +357,6 @@ class PackagesGetCommand extends FlutterCommand {
|
|||||||
);
|
);
|
||||||
// Not limiting to catching Exception because the exception is rethrown.
|
// Not limiting to catching Exception because the exception is rethrown.
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
// ignore: avoid_catches_without_on_clauses
|
|
||||||
final Duration elapsedDuration = timer.elapsed;
|
final Duration elapsedDuration = timer.elapsed;
|
||||||
analytics.send(
|
analytics.send(
|
||||||
Event.timing(
|
Event.timing(
|
||||||
|
@ -629,7 +629,6 @@ class UpdatePackagesCommand extends FlutterCommand {
|
|||||||
status.stop();
|
status.stop();
|
||||||
// The exception is rethrown, so don't catch only Exceptions.
|
// The exception is rethrown, so don't catch only Exceptions.
|
||||||
} catch (exception) {
|
} catch (exception) {
|
||||||
// ignore: avoid_catches_without_on_clauses
|
|
||||||
status.cancel();
|
status.cancel();
|
||||||
rethrow;
|
rethrow;
|
||||||
}
|
}
|
||||||
|
@ -664,7 +664,6 @@ void _validateFlutter(YamlMap? yaml, List<String> errors) {
|
|||||||
|
|
||||||
for (int i = 0; i < yamlList.length; i++) {
|
for (int i = 0; i < yamlList.length; i++) {
|
||||||
if (yamlList[i] is! T) {
|
if (yamlList[i] is! T) {
|
||||||
// ignore: avoid_dynamic_calls
|
|
||||||
errors.add(
|
errors.add(
|
||||||
'Expected $context to be a list of $typeAlias, but element at index $i was a ${yamlList[i].runtimeType}.',
|
'Expected $context to be a list of $typeAlias, but element at index $i was a ${yamlList[i].runtimeType}.',
|
||||||
);
|
);
|
||||||
@ -682,7 +681,6 @@ void _validateDeferredComponents(MapEntry<Object?, Object?> kvp, List<String> er
|
|||||||
for (int i = 0; i < yamlList.length; i++) {
|
for (int i = 0; i < yamlList.length; i++) {
|
||||||
final Object? valueMap = yamlList[i];
|
final Object? valueMap = yamlList[i];
|
||||||
if (valueMap is! YamlMap) {
|
if (valueMap is! YamlMap) {
|
||||||
// ignore: avoid_dynamic_calls
|
|
||||||
errors.add(
|
errors.add(
|
||||||
'Expected the $i element in "${kvp.key}" to be a map, but got ${yamlList[i]} (${yamlList[i].runtimeType}).',
|
'Expected the $i element in "${kvp.key}" to be a map, but got ${yamlList[i]} (${yamlList[i].runtimeType}).',
|
||||||
);
|
);
|
||||||
|
@ -1799,7 +1799,6 @@ class TerminalHandler {
|
|||||||
await _commonTerminalInputHandler(command);
|
await _commonTerminalInputHandler(command);
|
||||||
// Catch all exception since this is doing cleanup and rethrowing.
|
// Catch all exception since this is doing cleanup and rethrowing.
|
||||||
} catch (error, st) {
|
} catch (error, st) {
|
||||||
// ignore: avoid_catches_without_on_clauses
|
|
||||||
// Don't print stack traces for known error types.
|
// Don't print stack traces for known error types.
|
||||||
if (error is! ToolExit) {
|
if (error is! ToolExit) {
|
||||||
_logger.printError('$error\n$st');
|
_logger.printError('$error\n$st');
|
||||||
|
@ -258,7 +258,6 @@ class HotRunner extends ResidentRunner {
|
|||||||
);
|
);
|
||||||
// Catches all exceptions, non-Exception objects are rethrown.
|
// Catches all exceptions, non-Exception objects are rethrown.
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// ignore: avoid_catches_without_on_clauses
|
|
||||||
if (error is! Exception && error is! String) {
|
if (error is! Exception && error is! String) {
|
||||||
rethrow;
|
rethrow;
|
||||||
}
|
}
|
||||||
|
@ -991,7 +991,6 @@ class BrowserManager {
|
|||||||
return await controller.suite;
|
return await controller.suite;
|
||||||
// Not limiting to catching Exception because the exception is rethrown.
|
// Not limiting to catching Exception because the exception is rethrown.
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
// ignore: avoid_catches_without_on_clauses
|
|
||||||
closeIframe();
|
closeIframe();
|
||||||
rethrow;
|
rethrow;
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,6 @@ class Tracing {
|
|||||||
}
|
}
|
||||||
// The exception is rethrown, so don't catch only Exceptions.
|
// The exception is rethrown, so don't catch only Exceptions.
|
||||||
} catch (exception) {
|
} catch (exception) {
|
||||||
// ignore: avoid_catches_without_on_clauses
|
|
||||||
status.cancel();
|
status.cancel();
|
||||||
rethrow;
|
rethrow;
|
||||||
}
|
}
|
||||||
|
@ -1237,7 +1237,6 @@ void main() {
|
|||||||
try {
|
try {
|
||||||
await createTestCommandRunner(command).run(<String>['run', '--no-pub']);
|
await createTestCommandRunner(command).run(<String>['run', '--no-pub']);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// ignore: avoid_catches_without_on_clauses
|
|
||||||
fail('Expected no error, got $err');
|
fail('Expected no error, got $err');
|
||||||
}
|
}
|
||||||
expect(fakeTerminal.setSingleCharModeHistory, isEmpty);
|
expect(fakeTerminal.setSingleCharModeHistory, isEmpty);
|
||||||
|
@ -1168,7 +1168,6 @@ void main() {
|
|||||||
expect(schemeFile.existsSync(), isTrue);
|
expect(schemeFile.existsSync(), isTrue);
|
||||||
expect(schemeFile.readAsStringSync(), contains('FilePath = "/path/to/bundle"'));
|
expect(schemeFile.readAsStringSync(), contains('FilePath = "/path/to/bundle"'));
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// ignore: avoid_catches_without_on_clauses
|
|
||||||
fail(err.toString());
|
fail(err.toString());
|
||||||
} finally {
|
} finally {
|
||||||
projectDirectory.deleteSync(recursive: true);
|
projectDirectory.deleteSync(recursive: true);
|
||||||
|
@ -291,7 +291,6 @@ OS 版本: 10.0.22621 暂缺 Build 22621
|
|||||||
try {
|
try {
|
||||||
final ProcessResult result = await processLister.getProcessesWithPath();
|
final ProcessResult result = await processLister.getProcessesWithPath();
|
||||||
expect(result.stdout, ProcessLister.powershell);
|
expect(result.stdout, ProcessLister.powershell);
|
||||||
// ignore: avoid_catches_without_on_clauses
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
fail('Unexpected exception: $e');
|
fail('Unexpected exception: $e');
|
||||||
}
|
}
|
||||||
@ -312,7 +311,6 @@ OS 版本: 10.0.22621 暂缺 Build 22621
|
|||||||
try {
|
try {
|
||||||
final ProcessResult result = await processLister.getProcessesWithPath();
|
final ProcessResult result = await processLister.getProcessesWithPath();
|
||||||
expect(result.stdout, ProcessLister.pwsh);
|
expect(result.stdout, ProcessLister.pwsh);
|
||||||
// ignore: avoid_catches_without_on_clauses
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
fail('Unexpected exception: $e');
|
fail('Unexpected exception: $e');
|
||||||
}
|
}
|
||||||
@ -332,7 +330,6 @@ OS 版本: 10.0.22621 暂缺 Build 22621
|
|||||||
fail('Should have thrown, but successfully ran ${result.stdout}');
|
fail('Should have thrown, but successfully ran ${result.stdout}');
|
||||||
} on StateError {
|
} on StateError {
|
||||||
// Expected
|
// Expected
|
||||||
// ignore: avoid_catches_without_on_clauses
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
fail('Unexpected exception: $e');
|
fail('Unexpected exception: $e');
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,6 @@ Future<void> expectToolExitLater(Future<dynamic> future, Matcher messageMatcher)
|
|||||||
expect(e.message, messageMatcher);
|
expect(e.message, messageMatcher);
|
||||||
// Catch all exceptions to give a better test failure message.
|
// Catch all exceptions to give a better test failure message.
|
||||||
} catch (e, trace) {
|
} catch (e, trace) {
|
||||||
// ignore: avoid_catches_without_on_clauses
|
|
||||||
fail('ToolExit expected, got $e\n$trace');
|
fail('ToolExit expected, got $e\n$trace');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -160,7 +159,6 @@ Future<void> expectReturnsNormallyLater(Future<dynamic> future) async {
|
|||||||
await future;
|
await future;
|
||||||
// Catch all exceptions to give a better test failure message.
|
// Catch all exceptions to give a better test failure message.
|
||||||
} catch (e, trace) {
|
} catch (e, trace) {
|
||||||
// ignore: avoid_catches_without_on_clauses
|
|
||||||
fail('Expected to run with no exceptions, got $e\n$trace');
|
fail('Expected to run with no exceptions, got $e\n$trace');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,6 @@ class MemoryIOSink implements IOSink {
|
|||||||
add(data);
|
add(data);
|
||||||
// Catches all exceptions to propagate them to the completer.
|
// Catches all exceptions to propagate them to the completer.
|
||||||
} catch (err, stack) {
|
} catch (err, stack) {
|
||||||
// ignore: avoid_catches_without_on_clauses
|
|
||||||
sub.cancel();
|
sub.cancel();
|
||||||
completer.completeError(err, stack);
|
completer.completeError(err, stack);
|
||||||
}
|
}
|
||||||
@ -201,10 +200,8 @@ class MemoryStdout extends MemoryIOSink implements io.Stdout {
|
|||||||
bool _hasTerminal = true;
|
bool _hasTerminal = true;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
// ignore: override_on_non_overriding_member
|
|
||||||
String get lineTerminator => '\n';
|
String get lineTerminator => '\n';
|
||||||
@override
|
@override
|
||||||
// ignore: override_on_non_overriding_member
|
|
||||||
set lineTerminator(String value) {
|
set lineTerminator(String value) {
|
||||||
throw UnimplementedError('Setting the line terminator is not supported');
|
throw UnimplementedError('Setting the line terminator is not supported');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user