mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
flutter_tools: Remove unused //ignore comments; change flutter-specific ones to "ignore_for_flutter" (#45917)
This commit is contained in:
parent
e7fec2bc33
commit
f28592018d
@ -2,8 +2,8 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
import 'dart:io'; // ignore: dart_io_import.
|
import 'dart:io'; // ignore_for_flutter: dart_io_import.
|
||||||
import 'package:path/path.dart' as path; // ignore: package_path_import.
|
import 'package:path/path.dart' as path; // ignore_for_flutter: package_path_import.
|
||||||
|
|
||||||
/// Executes the required flutter tasks for a desktop build.
|
/// Executes the required flutter tasks for a desktop build.
|
||||||
Future<void> main(List<String> arguments) async {
|
Future<void> main(List<String> arguments) async {
|
||||||
|
@ -3,6 +3,10 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
// ignore_for_file: implementation_imports
|
// ignore_for_file: implementation_imports
|
||||||
|
// The "// ignore:" comments found in strings in this file are counted as _actual_ ignore comments.
|
||||||
|
// Since the "// ignore:" comments found in strings don't actually ignore anythin in _this_ file,
|
||||||
|
// we must allow them to be "unused." See https://github.com/dart-lang/sdk/issues/39607.
|
||||||
|
// ignore_for_file: unused_ignore_code
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:isolate';
|
import 'dart:isolate';
|
||||||
|
|
||||||
@ -22,7 +26,7 @@ import 'package:build_test/src/debug_test_builder.dart';
|
|||||||
import 'package:build_web_compilers/build_web_compilers.dart';
|
import 'package:build_web_compilers/build_web_compilers.dart';
|
||||||
import 'package:build_web_compilers/builders.dart';
|
import 'package:build_web_compilers/builders.dart';
|
||||||
import 'package:build_web_compilers/src/dev_compiler_bootstrap.dart';
|
import 'package:build_web_compilers/src/dev_compiler_bootstrap.dart';
|
||||||
import 'package:path/path.dart' as path; // ignore: package_path_import
|
import 'package:path/path.dart' as path; // ignore_for_flutter: package_path_import
|
||||||
import 'package:test_core/backend.dart'; // ignore: deprecated_member_use
|
import 'package:test_core/backend.dart'; // ignore: deprecated_member_use
|
||||||
|
|
||||||
const String ddcBootstrapExtension = '.dart.bootstrap.js';
|
const String ddcBootstrapExtension = '.dart.bootstrap.js';
|
||||||
|
@ -2,9 +2,8 @@
|
|||||||
// 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: implementation_imports
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io' as io; // ignore: dart_io_import
|
import 'dart:io' as io; // ignore_for_flutter: dart_io_import
|
||||||
|
|
||||||
import 'package:build/build.dart';
|
import 'package:build/build.dart';
|
||||||
import 'package:build_daemon/client.dart';
|
import 'package:build_daemon/client.dart';
|
||||||
|
@ -159,8 +159,8 @@ String generateTestBootstrap({
|
|||||||
final StringBuffer buffer = StringBuffer();
|
final StringBuffer buffer = StringBuffer();
|
||||||
buffer.write('''
|
buffer.write('''
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert'; // ignore: dart_convert_import
|
import 'dart:convert'; // ignore_for_flutter: dart_convert_import
|
||||||
import 'dart:io'; // ignore: dart_io_import
|
import 'dart:io'; // ignore_for_flutter: dart_io_import
|
||||||
import 'dart:isolate';
|
import 'dart:isolate';
|
||||||
|
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
@ -9,7 +9,7 @@ import 'dart:typed_data';
|
|||||||
|
|
||||||
import 'package:async/async.dart';
|
import 'package:async/async.dart';
|
||||||
import 'package:http_multi_server/http_multi_server.dart';
|
import 'package:http_multi_server/http_multi_server.dart';
|
||||||
import 'package:path/path.dart' as p; // ignore: package_path_import
|
import 'package:path/path.dart' as p; // ignore_for_flutter: package_path_import
|
||||||
import 'package:pool/pool.dart';
|
import 'package:pool/pool.dart';
|
||||||
import 'package:shelf/shelf.dart' as shelf;
|
import 'package:shelf/shelf.dart' as shelf;
|
||||||
import 'package:shelf/shelf_io.dart' as shelf_io;
|
import 'package:shelf/shelf_io.dart' as shelf_io;
|
||||||
|
@ -2,6 +2,10 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
|
// The "// ignore:" comments found in strings in this file are counted as _actual_ ignore comments.
|
||||||
|
// Since the "// ignore:" comments found in strings don't actually ignore anythin in _this_ file,
|
||||||
|
// we must allow them to be "unused." See https://github.com/dart-lang/sdk/issues/39607.
|
||||||
|
// ignore_for_file: unused_ignore_code
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter_tools/src/base/file_system.dart';
|
import 'package:flutter_tools/src/base/file_system.dart';
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io'; // ignore: dart_io_import
|
import 'dart:io'; // ignore_for_flutter: dart_io_import
|
||||||
|
|
||||||
import 'package:file/file.dart';
|
import 'package:file/file.dart';
|
||||||
import 'package:file/memory.dart';
|
import 'package:file/memory.dart';
|
||||||
|
@ -230,7 +230,7 @@ flutter:
|
|||||||
expect(fooFontAsset1.style, 'italic');
|
expect(fooFontAsset1.style, 'italic');
|
||||||
|
|
||||||
final Font barFont = fonts[1];
|
final Font barFont = fonts[1];
|
||||||
const String fontDescriptor = '{family: bar, fonts: [{asset: a/baz}, {weight: 400, style: italic, asset: a/baz}]}'; // ignore: always_specify_types
|
const String fontDescriptor = '{family: bar, fonts: [{asset: a/baz}, {weight: 400, style: italic, asset: a/baz}]}';
|
||||||
expect(barFont.descriptor.toString(), fontDescriptor);
|
expect(barFont.descriptor.toString(), fontDescriptor);
|
||||||
expect(barFont.familyName, 'bar');
|
expect(barFont.familyName, 'bar');
|
||||||
final List<FontAsset> barAssets = barFont.fontAssets;
|
final List<FontAsset> barAssets = barFont.fontAssets;
|
||||||
|
@ -52,7 +52,7 @@ void main() {
|
|||||||
for (File file in files) {
|
for (File file in files) {
|
||||||
for (String line in file.readAsLinesSync()) {
|
for (String line in file.readAsLinesSync()) {
|
||||||
if (line.startsWith(RegExp(r'import.*dart:io')) &&
|
if (line.startsWith(RegExp(r'import.*dart:io')) &&
|
||||||
!line.contains('ignore: dart_io_import')) {
|
!line.contains('ignore_for_flutter: dart_io_import')) {
|
||||||
final String relativePath = fs.path.relative(file.path, from:flutterTools);
|
final String relativePath = fs.path.relative(file.path, from:flutterTools);
|
||||||
fail("$relativePath imports 'dart:io'; import 'lib/src/base/io.dart' instead");
|
fail("$relativePath imports 'dart:io'; import 'lib/src/base/io.dart' instead");
|
||||||
}
|
}
|
||||||
@ -99,7 +99,7 @@ void main() {
|
|||||||
for (File file in files) {
|
for (File file in files) {
|
||||||
for (String line in file.readAsLinesSync()) {
|
for (String line in file.readAsLinesSync()) {
|
||||||
if (line.startsWith(RegExp(r'import.*package:path/path.dart')) &&
|
if (line.startsWith(RegExp(r'import.*package:path/path.dart')) &&
|
||||||
!line.contains('ignore: package_path_import')) {
|
!line.contains('ignore_for_flutter: package_path_import')) {
|
||||||
final String relativePath = fs.path.relative(file.path, from:flutterTools);
|
final String relativePath = fs.path.relative(file.path, from:flutterTools);
|
||||||
fail("$relativePath imports 'package:path/path.dart'; use 'fs.path' instead");
|
fail("$relativePath imports 'package:path/path.dart'; use 'fs.path' instead");
|
||||||
}
|
}
|
||||||
@ -124,7 +124,7 @@ void main() {
|
|||||||
for (File file in files) {
|
for (File file in files) {
|
||||||
for (String line in file.readAsLinesSync()) {
|
for (String line in file.readAsLinesSync()) {
|
||||||
if (line.startsWith(RegExp(r'import.*dart:convert')) &&
|
if (line.startsWith(RegExp(r'import.*dart:convert')) &&
|
||||||
!line.contains('ignore: dart_convert_import')) {
|
!line.contains('ignore_for_flutter: dart_convert_import')) {
|
||||||
final String relativePath = fs.path.relative(file.path, from:flutterTools);
|
final String relativePath = fs.path.relative(file.path, from:flutterTools);
|
||||||
fail("$relativePath imports 'dart:convert'; import 'lib/src/convert.dart' instead");
|
fail("$relativePath imports 'dart:convert'; import 'lib/src/convert.dart' instead");
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,10 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
|
// The "// ignore:" comments found in strings in this file are counted as _actual_ ignore comments.
|
||||||
|
// Since the "// ignore:" comments found in strings don't actually ignore anythin in _this_ file,
|
||||||
|
// we must allow them to be "unused." See https://github.com/dart-lang/sdk/issues/39607.
|
||||||
|
// ignore_for_file: unused_ignore_code
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
Loading…
Reference in New Issue
Block a user