Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CQ] cleanup unnecessary_ignores #8825

Merged
merged 2 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd.

// ignore_for_file: invalid_use_of_visible_for_testing_member, valid use for benchmark tests.

import 'dart:async';

import 'package:devtools_app/devtools_app.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// Do not delete these arguments. They are parsed by test runner.
// test-argument:appPath="test/test_infra/fixtures/memory_app"

// ignore_for_file: avoid_print

import 'package:devtools_test/helpers.dart';
import 'package:devtools_test/integration_test.dart';
import 'package:flutter_test/flutter_test.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd.

// ignore_for_file: avoid_print

import 'dart:async';
import 'dart:convert';
import 'dart:io';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd.

// ignore_for_file: avoid_print

import 'dart:async';
import 'dart:convert';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

// TODO(https://github.com/flutter/devtools/issues/4717): migrate away from
// deprecated members.
// ignore_for_file: deprecated_member_use

import 'dart:async';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ class EnhanceTracingController extends DisposableController
_firstLiveFrameId == null) {
_firstLiveFrameId =
FlutterFrame.fromJson(event.extensionData!.data).id;
// See https://github.com/dart-lang/linter/issues/3801
// ignore: discarded_futures
unawaited(_firstFrameEventSubscription!.cancel());
_firstFrameEventSubscription = null;
}
Expand Down Expand Up @@ -120,8 +118,6 @@ class EnhanceTracingController extends DisposableController
@override
void dispose() {
unawaited(showMenuStreamController.close());
// See https://github.com/dart-lang/linter/issues/3801
// ignore: discarded_futures
unawaited(_firstFrameEventSubscription?.cancel());
super.dispose();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,9 @@ class ChartController extends DisposableController
// Greater or equal to range we're zooming in on?
if (lastDT.difference(firstDT).inMinutes >= duration.inMinutes) {
// Grab the duration in minutes passed in.
final startOfLastNMinutes =
// We need this cast to be able to return null if nothing is found.
// ignore: unnecessary_cast
timestamps.reversed.firstWhereOrNull((timestamp) {
final startOfLastNMinutes = timestamps.reversed.firstWhereOrNull((
timestamp,
) {
final currentDT = DateTime.fromMillisecondsSinceEpoch(timestamp);
final diff = lastDT.difference(currentDT);
if (diff.inMinutes >= duration.inMinutes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ Future<T> allowedError<T>(Future<T> future, {bool logError = true}) {
_log.shout('[${error.runtimeType}] ${errorLines.first}');
_log.shout(errorLines.skip(1).join('\n'));
}
// TODO(srawlins): This is an illegal return value (`null`) for all `T`.
// This function must return an actual `T`.
// ignore: null_argument_to_non_null_type
return Future<T>.value();
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ Future<T> allowedError<T>(Future<T> future, {bool logError = true}) {
console.log(errorLines.skip(1).join('\n').toJS);
console.groupEnd();
}
// TODO(srawlins): This is an illegal return value (`null`) for all `T`.
// This function must return an actual `T`.
// ignore: null_argument_to_non_null_type
return Future<T>.value();
});
}
2 changes: 0 additions & 2 deletions packages/devtools_app/lib/src/shared/framework/screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,8 @@ enum ScreenMetaData {
title: 'Memory',
iconAsset: 'icons/app_bar/memory.png',
requiresDartVm: true,
// ignore: avoid_redundant_argument_values, false positive
requiresConnection: !FeatureFlags.memoryDisconnectExperience,
tutorialVideoTimestamp: '?t=420',
// ignore: avoid_redundant_argument_values, false positive
worksWithOfflineData: FeatureFlags.memoryDisconnectExperience,
),
debugger(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,14 @@
// https://github.com/dart-lang/sdk/blob/main/sdk/lib/_http/http_headers.dart#L965
// TODO(mossman): Is there a way to use dart:io directly?

// ignore_for_file: annotate_overrides
// ignore_for_file: empty_statements
// ignore_for_file: non_constant_identifier_names
// ignore_for_file: prefer_const_declarations
// ignore_for_file: prefer_contains
// ignore_for_file: prefer_final_locals
// ignore_for_file: prefer_is_empty
// ignore_for_file: prefer_single_quotes
// ignore_for_file: slash_for_doc_comments
// ignore_for_file: sort_constructors_first
// ignore_for_file: unnecessary_const
// ignore_for_file: unnecessary_new
// ignore_for_file: unused_catch_clause
// ignore_for_file: unused_element
// ignore_for_file: unused_local_variable

part of 'http.dart';

Expand Down
5 changes: 0 additions & 5 deletions packages/devtools_app/lib/src/shared/http/_http_date.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,11 @@
// This file was pulled from dart:io.

// ignore_for_file: empty_statements
// ignore_for_file: non_constant_identifier_names
// ignore_for_file: prefer_const_declarations
// ignore_for_file: prefer_final_locals
// ignore_for_file: prefer_is_empty
// ignore_for_file: prefer_single_quotes
// ignore_for_file: slash_for_doc_comments
// ignore_for_file: unnecessary_const
// ignore_for_file: unnecessary_new
// ignore_for_file: unused_catch_clause
// ignore_for_file: unused_local_variable
// ignore_for_file: avoid-throw-in-catch-block

part of 'http.dart';
Expand Down
3 changes: 0 additions & 3 deletions packages/devtools_app/lib/src/shared/ui/hover.dart
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,6 @@ class _HoverCardTooltipState extends State<HoverCardTooltip> {
// If we get no data back, then don't show a hover card.
if (data == null) return;
// Otherwise, show a hover card immediately.
// ignore: use_build_context_synchronously, requires investigation
return _setHoverCardFromData(
data,
// ignore: use_build_context_synchronously, requires investigation
Expand All @@ -459,7 +458,6 @@ class _HoverCardTooltipState extends State<HoverCardTooltip> {
}
// The data on the card is fetched asynchronously, so show a spinner
// while we wait for it.
// ignore: use_build_context_synchronously, requires investigation
spinnerHoverCard = HoverCard.fromHoverEvent(
// ignore: use_build_context_synchronously, requires investigation
context: context,
Expand All @@ -485,7 +483,6 @@ class _HoverCardTooltipState extends State<HoverCardTooltip> {
return;
}

// ignore: use_build_context_synchronously, requires investigation
return _setHoverCardFromData(
hoverCardData,
// ignore: use_build_context_synchronously, requires investigation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
// (the test verifies that breakpoints are hit at specific lines).

import 'package:flutter/material.dart';
// Unused imports are useful for testing autocomplete.
// ignore_for_file: unused_import
import 'src/autocomplete.dart';
import 'src/other_classes.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ class FlutterTestEnvironment {
setGlobal(DTDManager, DTDManager());

// Clear out VM service calls from the test driver.
// ignore: invalid_use_of_visible_for_testing_member
_service.clearVmServiceCalls();

await serviceConnection.serviceManager.vmServiceOpened(
Expand Down
1 change: 0 additions & 1 deletion packages/devtools_app_shared/lib/src/utils/list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ final class ListValueNotifier<T> extends ChangeNotifier

@override
// This override is needed to change visibility of the method.
// ignore: unnecessary_overrides
void notifyListeners() {
super.notifyListeners();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class ExtensionManager {
/// removed in [dispose].
EventListener? _handleMessageListener;

// ignore: unused_element, false positive due to part files
Future<void> _init() async {
window.addEventListener(
'message',
Expand Down Expand Up @@ -76,7 +75,6 @@ class ExtensionManager {
}
}

// ignore: unused_element, false positive due to part files
void _dispose() {
_registeredEventHandlers.clear();
window.removeEventListener('message', _handleMessageListener);
Expand Down
2 changes: 1 addition & 1 deletion packages/devtools_shared/lib/src/server/server_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd.

// ignore_for_file: avoid_classes_with_only_static_members, avoid_print
// ignore_for_file: avoid_print

import 'dart:async';
import 'dart:convert';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Future<void> resetHistory() async {
// the web-specific implementation of the Flutter Engine, at
// `lib/web_ui/lib/src/engine/window.dart` in the Flutter engine
// repository.
// ignore: avoid_dynamic_calls
.resetHistory();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import 'package:devtools_app_shared/src/service/service_extension_manager.dart';
import 'package:flutter/foundation.dart';
import 'package:mockito/mockito.dart';

// ignore: subtype_of_sealed_class, fake for testing.
/// Fake that simplifies writing UI tests that depend on the
/// ServiceExtensionManager.
// TODO(jacobr): refactor ServiceExtensionManager so this fake can reuse more
Expand Down
1 change: 0 additions & 1 deletion packages/devtools_test/lib/src/mocks/mocks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ void mockFlutterVersion(ConnectedApp connectedApp, SemanticVersion version) {
when(connectedApp.connectedAppInitialized).thenReturn(true);
}

// ignore: prefer_single_quotes, false positive.
final mockGrammar = Grammar.fromJson(
jsonDecode('''
{
Expand Down
Loading