Unverified Commit 79b5e5bc authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by GitHub

Add missing lints (#24381)

* update lint list

* enable sort_pub_dependencies

* enable avoid_returning_null_for_void

* enable flutter_style_todos
parent 15e3df25
...@@ -56,6 +56,7 @@ linter: ...@@ -56,6 +56,7 @@ linter:
- avoid_empty_else - avoid_empty_else
- avoid_field_initializers_in_const_classes - avoid_field_initializers_in_const_classes
- avoid_function_literals_in_foreach_calls - avoid_function_literals_in_foreach_calls
# - avoid_implementing_value_types # not yet tested
- avoid_init_to_null - avoid_init_to_null
# - avoid_js_rounded_ints # only useful when targeting JS runtime # - avoid_js_rounded_ints # only useful when targeting JS runtime
- avoid_null_checks_in_equality_operators - avoid_null_checks_in_equality_operators
...@@ -65,6 +66,7 @@ linter: ...@@ -65,6 +66,7 @@ linter:
- avoid_renaming_method_parameters - avoid_renaming_method_parameters
- avoid_return_types_on_setters - avoid_return_types_on_setters
# - avoid_returning_null # there are plenty of valid reasons to return null # - avoid_returning_null # there are plenty of valid reasons to return null
- avoid_returning_null_for_void
# - avoid_returning_this # there are plenty of valid reasons to return this # - avoid_returning_this # there are plenty of valid reasons to return this
# - avoid_setters_without_getters # not yet tested # - avoid_setters_without_getters # not yet tested
# - avoid_single_cascade_in_expression_statements # not yet tested # - avoid_single_cascade_in_expression_statements # not yet tested
...@@ -87,6 +89,7 @@ linter: ...@@ -87,6 +89,7 @@ linter:
- empty_constructor_bodies - empty_constructor_bodies
- empty_statements - empty_statements
# - file_names # not yet tested # - file_names # not yet tested
- flutter_style_todos
- hash_and_equals - hash_and_equals
- implementation_imports - implementation_imports
# - invariant_booleans # too many false positives: https://github.com/dart-lang/linter/issues/811 # - invariant_booleans # too many false positives: https://github.com/dart-lang/linter/issues/811
...@@ -128,6 +131,7 @@ linter: ...@@ -128,6 +131,7 @@ linter:
# - prefer_function_declarations_over_variables # not yet tested # - prefer_function_declarations_over_variables # not yet tested
- prefer_generic_function_type_aliases - prefer_generic_function_type_aliases
- prefer_initializing_formals - prefer_initializing_formals
# - prefer_int_literals # not yet tested
# - prefer_interpolation_to_compose_strings # not yet tested # - prefer_interpolation_to_compose_strings # not yet tested
- prefer_is_empty - prefer_is_empty
- prefer_is_not_empty - prefer_is_not_empty
...@@ -140,6 +144,7 @@ linter: ...@@ -140,6 +144,7 @@ linter:
- recursive_getters - recursive_getters
- slash_for_doc_comments - slash_for_doc_comments
- sort_constructors_first - sort_constructors_first
- sort_pub_dependencies
- sort_unnamed_constructors_first - sort_unnamed_constructors_first
- super_goes_last - super_goes_last
- test_types_in_equals - test_types_in_equals
......
...@@ -970,7 +970,7 @@ mixin WidgetInspectorService { ...@@ -970,7 +970,7 @@ mixin WidgetInspectorService {
getter: () async => _trackRebuildDirtyWidgets, getter: () async => _trackRebuildDirtyWidgets,
setter: (bool value) async { setter: (bool value) async {
if (value == _trackRebuildDirtyWidgets) { if (value == _trackRebuildDirtyWidgets) {
return null; return;
} }
_rebuildStats.resetCounts(); _rebuildStats.resetCounts();
_trackRebuildDirtyWidgets = value; _trackRebuildDirtyWidgets = value;
...@@ -979,10 +979,11 @@ mixin WidgetInspectorService { ...@@ -979,10 +979,11 @@ mixin WidgetInspectorService {
debugOnRebuildDirtyWidget = _onRebuildWidget; debugOnRebuildDirtyWidget = _onRebuildWidget;
// Trigger a rebuild so there are baseline stats for rebuilds // Trigger a rebuild so there are baseline stats for rebuilds
// performed by the app. // performed by the app.
return forceRebuild(); await forceRebuild();
return;
} else { } else {
debugOnRebuildDirtyWidget = null; debugOnRebuildDirtyWidget = null;
return null; return;
} }
}, },
); );
......
...@@ -563,10 +563,10 @@ void main() { ...@@ -563,10 +563,10 @@ void main() {
golden: 'TestTree#00000(stringProperty1: value1, doubleProperty1: 42.5, roundedProperty: 0.3, nullProperty: null, <root node>)', golden: 'TestTree#00000(stringProperty1: value1, doubleProperty1: 42.5, roundedProperty: 0.3, nullProperty: null, <root node>)',
); );
// TODO(jacobr): this is an ugly test case.
// There isn't anything interesting for this case as the children look the // There isn't anything interesting for this case as the children look the
// same with and without children. TODO(jacobr): this is an ugly test case. // same with and without children. Only difference is odd not clearly
// only difference is odd not clearly desirable density of B3 being right // desirable density of B3 being right next to node C.
// next to node C.
goldenStyleTest( goldenStyleTest(
'single line last child', 'single line last child',
style: DiagnosticsTreeStyle.sparse, style: DiagnosticsTreeStyle.sparse,
......
...@@ -97,7 +97,7 @@ Future<void> run(List<String> args) async { ...@@ -97,7 +97,7 @@ Future<void> run(List<String> args) async {
} }
// Put the tester shell where runTests expects it. // Put the tester shell where runTests expects it.
// TODO(tvolkert,garymm): Switch to a Fuchsia-specific Artifacts impl. // TODO(garymm): Switch to a Fuchsia-specific Artifacts impl.
final Link testerDestLink = final Link testerDestLink =
fs.link(artifacts.getArtifactPath(Artifact.flutterTester)); fs.link(artifacts.getArtifactPath(Artifact.flutterTester));
testerDestLink.parent.createSync(recursive: true); testerDestLink.parent.createSync(recursive: true);
......
...@@ -19,7 +19,7 @@ import '../run_hot.dart'; ...@@ -19,7 +19,7 @@ import '../run_hot.dart';
import '../runner/flutter_command.dart'; import '../runner/flutter_command.dart';
import 'daemon.dart'; import 'daemon.dart';
// TODO(flutter/flutter#23031): Test this. // TODO(mklim): Test this, flutter/flutter#23031.
abstract class RunCommandBase extends FlutterCommand { abstract class RunCommandBase extends FlutterCommand {
// Used by run and drive commands. // Used by run and drive commands.
RunCommandBase({ bool verboseHelp = false }) { RunCommandBase({ bool verboseHelp = false }) {
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +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: flutter_style_todos
import 'dart:async'; import 'dart:async';
import 'dart:collection'; import 'dart:collection';
......
...@@ -297,7 +297,7 @@ Future<XcodeBuildResult> buildXcodeProject({ ...@@ -297,7 +297,7 @@ Future<XcodeBuildResult> buildXcodeProject({
if (!_checkXcodeVersion()) if (!_checkXcodeVersion())
return XcodeBuildResult(success: false); return XcodeBuildResult(success: false);
// TODO(cbracken) remove when https://github.com/flutter/flutter/issues/20685 is fixed. // TODO(cbracken): remove when https://github.com/flutter/flutter/issues/20685 is fixed.
await setXcodeWorkspaceBuildSystem( await setXcodeWorkspaceBuildSystem(
workspaceDirectory: app.project.xcodeWorkspace, workspaceDirectory: app.project.xcodeWorkspace,
workspaceSettings: app.project.xcodeWorkspaceSharedSettings, workspaceSettings: app.project.xcodeWorkspaceSharedSettings,
...@@ -458,7 +458,7 @@ Future<XcodeBuildResult> buildXcodeProject({ ...@@ -458,7 +458,7 @@ Future<XcodeBuildResult> buildXcodeProject({
if (line == 'all done') { if (line == 'all done') {
// Free pipe file. // Free pipe file.
tempDir?.deleteSync(recursive: true); tempDir?.deleteSync(recursive: true);
return null; return;
} }
} else { } else {
initialBuildStatus.cancel(); initialBuildStatus.cancel();
...@@ -469,7 +469,7 @@ Future<XcodeBuildResult> buildXcodeProject({ ...@@ -469,7 +469,7 @@ Future<XcodeBuildResult> buildXcodeProject({
); );
} }
} }
return listenToScriptOutputLine(); await listenToScriptOutputLine();
} }
// Trigger the start of the pipe -> stdout loop. Ignore exceptions. // Trigger the start of the pipe -> stdout loop. Ignore exceptions.
......
...@@ -12,7 +12,7 @@ import 'globals.dart'; ...@@ -12,7 +12,7 @@ import 'globals.dart';
import 'resident_runner.dart'; import 'resident_runner.dart';
import 'tracing.dart'; import 'tracing.dart';
// TODO(flutter/flutter#23031): Test this. // TODO(mklim): Test this, flutter/flutter#23031.
class ColdRunner extends ResidentRunner { class ColdRunner extends ResidentRunner {
ColdRunner( ColdRunner(
List<FlutterDevice> devices, { List<FlutterDevice> devices, {
......
...@@ -48,7 +48,7 @@ class DeviceReloadReport { ...@@ -48,7 +48,7 @@ class DeviceReloadReport {
List<Map<String, dynamic>> reports; // List has one report per Flutter view. List<Map<String, dynamic>> reports; // List has one report per Flutter view.
} }
// TODO(flutter/flutter#23031): Test this. // TODO(mklim): Test this, flutter/flutter#23031.
class HotRunner extends ResidentRunner { class HotRunner extends ResidentRunner {
HotRunner( HotRunner(
List<FlutterDevice> devices, { List<FlutterDevice> devices, {
......
...@@ -102,7 +102,7 @@ const Duration kLongRequestTimeout = Duration(minutes: 1); ...@@ -102,7 +102,7 @@ const Duration kLongRequestTimeout = Duration(minutes: 1);
/// Used for RPC requests that should never take a long time. /// Used for RPC requests that should never take a long time.
const Duration kShortRequestTimeout = Duration(seconds: 5); const Duration kShortRequestTimeout = Duration(seconds: 5);
// TODO(flutter/flutter#23031): Test this. // TODO(mklim): Test this, flutter/flutter#23031.
/// A connection to the Dart VM Service. /// A connection to the Dart VM Service.
class VMService { class VMService {
VMService( VMService(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment