Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit a9f7fa8

Browse files
authored
Adjust some ignores for 'dart format' (#57208)
When running `dart format` over these lines the `// ignore` ended up on a line where it wasn't properly ignoring the lint. This adjusts the placement of `// ignore`s so they will continue to ignore the right thing even after the code is auto formatted. I am hoping that if we do this now the large PR that formats the entire repo will go in smoother without manual intervention.
1 parent 4e4a430 commit a9f7fa8

File tree

6 files changed

+17
-7
lines changed

6 files changed

+17
-7
lines changed

lib/ui/hooks.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@ typedef _ListStringArgFunction = Object? Function(List<String> args);
294294
void _runMain(Function startMainIsolateFunction,
295295
Function userMainFunction,
296296
List<String> args) {
297-
startMainIsolateFunction(() { // ignore: avoid_dynamic_calls
297+
// ignore: avoid_dynamic_calls
298+
startMainIsolateFunction(() {
298299
if (userMainFunction is _ListStringArgFunction) {
299300
userMainFunction(args);
300301
} else {

lib/web_ui/lib/src/engine/services/message_codecs.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,8 @@ class StandardMessageCodec implements MessageCodec<dynamic> {
310310
} else if (value is double) {
311311
buffer.putUint8(_valueFloat64);
312312
buffer.putFloat64(value);
313-
} else if (value is int) { // ignore: avoid_double_and_int_checks
313+
// ignore: avoid_double_and_int_checks
314+
} else if (value is int) {
314315
if (-0x7fffffff - 1 <= value && value <= 0x7fffffff) {
315316
buffer.putUint8(_valueInt32);
316317
buffer.putInt32(value);

lib/web_ui/test/engine/view/view_constraints_test.dart

+4-2
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,12 @@ Future<void> testMain() async {
145145
expect(
146146
ViewConstraints.fromJs(constraints, size),
147147
const ViewConstraints(
148+
minWidth: 500,
148149
// ignore: avoid_redundant_argument_values
149-
minWidth: 500, maxWidth: double.infinity,
150+
maxWidth: double.infinity,
151+
minHeight: 300,
150152
// ignore: avoid_redundant_argument_values
151-
minHeight: 300, maxHeight: double.infinity,
153+
maxHeight: double.infinity,
152154
));
153155
});
154156
});

testing/dart/image_filter_test.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ void main() async {
9292

9393
List<ColorFilter> colorFilters() {
9494
// Create new color filter instances on each invocation.
95-
return <ColorFilter> [ // ignore: prefer_const_constructors
95+
// ignore: prefer_const_constructors
96+
return <ColorFilter> [
9697
ColorFilter.mode(green, BlendMode.color), // ignore: prefer_const_constructors
9798
ColorFilter.mode(red, BlendMode.color), // ignore: prefer_const_constructors
9899
ColorFilter.mode(red, BlendMode.screen), // ignore: prefer_const_constructors

testing/scenario_app/lib/src/platform_view.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ List<int> _to64(num value) {
2222
final Uint8List temp = Uint8List(15);
2323
if (value is double) {
2424
temp.buffer.asByteData().setFloat64(7, value, Endian.little);
25-
} else if (value is int) { // ignore: avoid_double_and_int_checks
25+
// ignore: avoid_double_and_int_checks
26+
} else if (value is int) {
2627
temp.buffer.asByteData().setInt64(7, value, Endian.little);
2728
}
2829
return temp;

tools/const_finder/test/fixtures/lib/box.dart

+5-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,11 @@ const Box box2_98 = Box(box2_97, box2_97);
217217
const Box box2_99 = Box(box2_98, box2_98);
218218

219219
Object confuse(Box x) {
220-
try { throw x; } catch (e) { return e; } // ignore: only_throw_errors
220+
try {
221+
throw x; // ignore: only_throw_errors
222+
} catch (e) {
223+
return e;
224+
}
221225
}
222226

223227
void main() {

0 commit comments

Comments
 (0)