forked from firka/flutter
Sync lints (#68136)
This commit is contained in:
committed by
GitHub
parent
7181c7a86a
commit
73301a35a2
@@ -53,6 +53,7 @@ linter:
|
||||
# - always_put_required_named_parameters_first # we prefer having parameters in the same order as fields https://github.com/flutter/flutter/issues/10219
|
||||
- always_require_non_null_named_parameters
|
||||
- always_specify_types
|
||||
# - always_use_package_imports # we do this commonly
|
||||
- annotate_overrides
|
||||
# - avoid_annotating_with_dynamic # conflicts with always_specify_types
|
||||
# - avoid_as # required for implicit-casts: true
|
||||
@@ -63,6 +64,7 @@ linter:
|
||||
# - avoid_double_and_int_checks # only useful when targeting JS runtime
|
||||
- avoid_empty_else
|
||||
- avoid_equals_and_hash_code_on_mutable_classes
|
||||
# - avoid_escaping_inner_quotes # not yet tested
|
||||
- avoid_field_initializers_in_const_classes
|
||||
- avoid_function_literals_in_foreach_calls
|
||||
# - avoid_implementing_value_types # not yet tested
|
||||
@@ -84,6 +86,7 @@ linter:
|
||||
# - avoid_shadowing_type_parameters # not yet tested
|
||||
- avoid_single_cascade_in_expression_statements
|
||||
- avoid_slow_async_io
|
||||
# - avoid_type_to_string # we do this commonly
|
||||
- avoid_types_as_parameter_names
|
||||
# - avoid_types_on_closure_parameters # conflicts with always_specify_types
|
||||
# - avoid_unnecessary_containers # not yet tested
|
||||
@@ -103,9 +106,11 @@ linter:
|
||||
# - curly_braces_in_flow_control_structures # not yet tested
|
||||
# - diagnostic_describe_all_properties # not yet tested
|
||||
- directives_ordering
|
||||
# - do_not_use_environment # we do this commonly
|
||||
- empty_catches
|
||||
- empty_constructor_bodies
|
||||
- empty_statements
|
||||
- exhaustive_cases
|
||||
# - file_names # not yet tested
|
||||
- flutter_style_todos
|
||||
- hash_and_equals
|
||||
@@ -113,6 +118,7 @@ linter:
|
||||
# - invariant_booleans # too many false positives: https://github.com/dart-lang/linter/issues/811
|
||||
- iterable_contains_unrelated_type
|
||||
# - join_return_with_assignment # not yet tested
|
||||
- leading_newlines_in_multiline_strings
|
||||
- library_names
|
||||
- library_prefixes
|
||||
# - lines_longer_than_80_chars # not yet tested
|
||||
@@ -120,6 +126,7 @@ linter:
|
||||
# - literal_only_boolean_expressions # too many false positives: https://github.com/dart-lang/sdk/issues/34181
|
||||
# - missing_whitespace_between_adjacent_strings # not yet tested
|
||||
- no_adjacent_strings_in_list
|
||||
# - no_default_cases # too many false positives
|
||||
- no_duplicate_case_values
|
||||
# - no_logic_in_create_state # not yet tested
|
||||
# - no_runtimeType_toString # not yet tested
|
||||
@@ -175,6 +182,7 @@ linter:
|
||||
# - provide_deprecation_message # not yet tested
|
||||
# - public_member_api_docs # enabled on a case-by-case basis; see e.g. packages/analysis_options.yaml
|
||||
- recursive_getters
|
||||
# - sized_box_for_whitespace # not yet tested
|
||||
- slash_for_doc_comments
|
||||
# - sort_child_properties_last # not yet tested
|
||||
- sort_constructors_first
|
||||
@@ -194,19 +202,24 @@ linter:
|
||||
# - unnecessary_lambdas # has false positives: https://github.com/dart-lang/linter/issues/498
|
||||
- unnecessary_new
|
||||
- unnecessary_null_aware_assignments
|
||||
# - unnecessary_null_checks # not yet tested
|
||||
- unnecessary_null_in_if_null_operators
|
||||
- unnecessary_nullable_for_final_variable_declarations
|
||||
- unnecessary_overrides
|
||||
- unnecessary_parenthesis
|
||||
# - unnecessary_raw_strings # not yet tested
|
||||
- unnecessary_statements
|
||||
# - unnecessary_string_escapes # not yet tested
|
||||
- unnecessary_string_interpolations
|
||||
- unnecessary_this
|
||||
- unrelated_type_equality_checks
|
||||
# - unsafe_html # not yet tested
|
||||
- use_full_hex_values_for_flutter_colors
|
||||
# - use_function_type_syntax_for_parameters # not yet tested
|
||||
# - use_is_even_rather_than_modulo # not yet tested
|
||||
# - use_key_in_widget_constructors # not yet tested
|
||||
- use_late_for_private_fields_and_variables
|
||||
# - use_raw_strings # not yet tested
|
||||
- use_rethrow_when_possible
|
||||
# - use_setters_to_change_properties # not yet tested
|
||||
# - use_string_buffers # has false positives: https://github.com/dart-lang/sdk/issues/34182
|
||||
|
||||
@@ -19,7 +19,8 @@ Future<void> main() async {
|
||||
final File subtagRegistry = File('../language_subtag_registry.dart');
|
||||
final File subtagRegistryFlutterTools = File('../../../../packages/flutter_tools/lib/src/localizations/language_subtag_registry.dart');
|
||||
|
||||
final String content = '''// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
final String content = '''
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
/// Cache of https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry.
|
||||
const String languageSubtagRegistry = '''File-Date: 2020-03-16
|
||||
const String languageSubtagRegistry = '''
|
||||
File-Date: 2020-03-16
|
||||
%%
|
||||
Type: language
|
||||
Subtag: aa
|
||||
|
||||
@@ -253,8 +253,8 @@ void _testIsMapSuperset(Map<String, String> newCodepoints, Map<String, String> o
|
||||
final Set<String> oldCodepointsSet = oldCodepoints.keys.toSet();
|
||||
|
||||
if (!newCodepointsSet.containsAll(oldCodepointsSet)) {
|
||||
stderr.writeln(
|
||||
'''Error: New codepoints file does not contain all the existing codepoints.\n
|
||||
stderr.writeln('''
|
||||
Error: New codepoints file does not contain all the existing codepoints.\n
|
||||
Missing: ${oldCodepointsSet.difference(newCodepointsSet)}
|
||||
''',
|
||||
);
|
||||
|
||||
@@ -652,7 +652,7 @@ class _ContextMenuRoute<T> extends PopupRoute<T> {
|
||||
return AlignmentDirectional.topCenter;
|
||||
case _ContextMenuLocation.right:
|
||||
return AlignmentDirectional.topEnd;
|
||||
default:
|
||||
case _ContextMenuLocation.left:
|
||||
return AlignmentDirectional.topStart;
|
||||
}
|
||||
}
|
||||
@@ -671,7 +671,7 @@ class _ContextMenuRoute<T> extends PopupRoute<T> {
|
||||
? childRect.bottomRight
|
||||
: childRect.topRight;
|
||||
return (target - Offset(sheetRect.width, 0.0)) & sheetRect.size;
|
||||
default:
|
||||
case _ContextMenuLocation.left:
|
||||
final Offset target = orientation == Orientation.portrait
|
||||
? childRect.bottomLeft
|
||||
: childRect.topLeft;
|
||||
@@ -978,7 +978,7 @@ class _ContextMenuRouteStaticState extends State<_ContextMenuRouteStatic> with T
|
||||
return orientation == Orientation.portrait
|
||||
? Alignment.bottomCenter
|
||||
: Alignment.topLeft;
|
||||
default:
|
||||
case _ContextMenuLocation.left:
|
||||
return orientation == Orientation.portrait
|
||||
? Alignment.bottomCenter
|
||||
: Alignment.topRight;
|
||||
@@ -1060,7 +1060,7 @@ class _ContextMenuRouteStaticState extends State<_ContextMenuRouteStatic> with T
|
||||
return orientation == Orientation.portrait
|
||||
? <Widget>[child, spacer, sheet]
|
||||
: <Widget>[sheet, spacer, child];
|
||||
default:
|
||||
case _ContextMenuLocation.left:
|
||||
return <Widget>[child, spacer, sheet];
|
||||
}
|
||||
}
|
||||
@@ -1233,7 +1233,7 @@ class _ContextMenuSheet extends StatelessWidget {
|
||||
),
|
||||
menu,
|
||||
];
|
||||
default:
|
||||
case _ContextMenuLocation.left:
|
||||
return <Widget>[
|
||||
menu,
|
||||
const Spacer(
|
||||
|
||||
@@ -1363,8 +1363,6 @@ class _CupertinoDatePickerDateState extends State<CupertinoDatePicker> {
|
||||
estimatedColumnWidths[_PickerColumnType.month.index]!,
|
||||
];
|
||||
break;
|
||||
default:
|
||||
assert(false, 'date order is not specified');
|
||||
}
|
||||
|
||||
final List<Widget> pickers = <Widget>[];
|
||||
|
||||
@@ -102,7 +102,6 @@ Widget _wrapWithBackground({
|
||||
overlayStyle = SystemUiOverlayStyle.light;
|
||||
break;
|
||||
case Brightness.light:
|
||||
default:
|
||||
overlayStyle = SystemUiOverlayStyle.dark;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -467,7 +467,7 @@ class CupertinoSliverRefreshControl extends StatefulWidget {
|
||||
case RefreshIndicatorMode.done:
|
||||
// When the user lets go, the standard transition is to shrink the spinner.
|
||||
return CupertinoActivityIndicator(radius: radius * percentageComplete);
|
||||
default:
|
||||
case RefreshIndicatorMode.inactive:
|
||||
// Anything else doesn't show anything.
|
||||
return Container();
|
||||
}
|
||||
|
||||
@@ -556,7 +556,7 @@ class _CupertinoTextSelectionControls extends TextSelectionControls {
|
||||
handleSize.height - 2 * _kSelectionHandleRadius + _kSelectionHandleOverlap,
|
||||
);
|
||||
// A collapsed handle anchors itself so that it's centered.
|
||||
default:
|
||||
case TextSelectionHandleType.collapsed:
|
||||
return Offset(
|
||||
handleSize.width / 2,
|
||||
textLineHeight + (handleSize.height - textLineHeight) / 2,
|
||||
|
||||
@@ -20,7 +20,7 @@ int _synthesiseDownButtons(int buttons, PointerDeviceKind kind) {
|
||||
case PointerDeviceKind.stylus:
|
||||
case PointerDeviceKind.invertedStylus:
|
||||
return buttons | kPrimaryButton;
|
||||
default:
|
||||
case PointerDeviceKind.unknown:
|
||||
// We have no information about the device but we know we never want
|
||||
// buttons to be 0 when the pointer is down.
|
||||
return buttons == 0 ? kPrimaryButton : buttons;
|
||||
|
||||
@@ -1282,7 +1282,6 @@ class _MasterDetailFlowState extends State<_MasterDetailFlow> implements _PageOp
|
||||
case _LayoutMode.lateral:
|
||||
return _lateralUI(context);
|
||||
case _LayoutMode.auto:
|
||||
default:
|
||||
return LayoutBuilder(
|
||||
builder: (BuildContext context, BoxConstraints constraints) {
|
||||
final double availableWidth = constraints.maxWidth;
|
||||
@@ -1310,7 +1309,6 @@ class _MasterDetailFlowState extends State<_MasterDetailFlow> implements _PageOp
|
||||
case _Focus.master:
|
||||
return <Route<void>>[masterPageRoute];
|
||||
case _Focus.detail:
|
||||
default:
|
||||
return <Route<void>>[
|
||||
masterPageRoute,
|
||||
_detailPageRoute(_cachedDetailArguments)
|
||||
|
||||
@@ -989,7 +989,7 @@ class _HighlightPainter extends CustomPainter {
|
||||
paint,
|
||||
);
|
||||
break;
|
||||
default:
|
||||
case _HighlightPainterStyle.none:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,7 +255,6 @@ class _ReorderableListContentState extends State<_ReorderableListContent> with T
|
||||
dropAreaWithoutMargin = _draggingFeedbackSize!.width;
|
||||
break;
|
||||
case Axis.vertical:
|
||||
default:
|
||||
dropAreaWithoutMargin = _draggingFeedbackSize!.height;
|
||||
break;
|
||||
}
|
||||
@@ -349,7 +348,6 @@ class _ReorderableListContentState extends State<_ReorderableListContent> with T
|
||||
case Axis.horizontal:
|
||||
return Row(children: children);
|
||||
case Axis.vertical:
|
||||
default:
|
||||
return Column(children: children);
|
||||
}
|
||||
}
|
||||
@@ -494,7 +492,6 @@ class _ReorderableListContentState extends State<_ReorderableListContent> with T
|
||||
spacing = SizedBox(width: _dropAreaExtent);
|
||||
break;
|
||||
case Axis.vertical:
|
||||
default:
|
||||
spacing = SizedBox(height: _dropAreaExtent);
|
||||
break;
|
||||
}
|
||||
@@ -561,7 +558,6 @@ class _ReorderableListContentState extends State<_ReorderableListContent> with T
|
||||
);
|
||||
break;
|
||||
case Axis.vertical:
|
||||
default:
|
||||
finalDropArea = SizedBox(
|
||||
key: endWidgetKey,
|
||||
height: _defaultDropAreaExtent,
|
||||
|
||||
@@ -110,7 +110,6 @@ class RawKeyEventDataWeb extends RawKeyEventData {
|
||||
return metaState & modifierScrollLock != 0;
|
||||
case ModifierKey.functionModifier:
|
||||
case ModifierKey.symbolModifier:
|
||||
default:
|
||||
// On Web, the browser doesn't report the state of the FN and SYM modifiers.
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -710,7 +710,7 @@ class _InteractiveViewerState extends State<InteractiveViewer> with TickerProvid
|
||||
return widget.scaleEnabled;
|
||||
|
||||
case _GestureType.pan:
|
||||
default:
|
||||
case null:
|
||||
return widget.panEnabled;
|
||||
}
|
||||
}
|
||||
@@ -1238,7 +1238,6 @@ Offset _alignAxis(Offset offset, Axis axis) {
|
||||
case Axis.horizontal:
|
||||
return Offset(offset.dx, 0.0);
|
||||
case Axis.vertical:
|
||||
default:
|
||||
return Offset(0.0, offset.dy);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,8 +99,6 @@ Future<void> dismissElement(WidgetTester tester, Finder finder, { required AxisD
|
||||
downLocation = tester.getTopLeft(finder) + const Offset(0.1, 0.0);
|
||||
upLocation = tester.getBottomLeft(finder);
|
||||
break;
|
||||
default:
|
||||
fail('unsupported gestureDirection');
|
||||
}
|
||||
|
||||
final TestGesture gesture = await tester.startGesture(downLocation);
|
||||
@@ -123,8 +121,6 @@ Future<void> flingElement(WidgetTester tester, Finder finder, { required AxisDir
|
||||
case AxisDirection.down:
|
||||
delta = const Offset(0.0, 300.0);
|
||||
break;
|
||||
default:
|
||||
fail('unsupported gestureDirection');
|
||||
}
|
||||
await tester.fling(finder, delta, 1000.0, initialOffset: delta * initialOffsetFactor);
|
||||
}
|
||||
|
||||
@@ -3643,8 +3643,6 @@ void main() {
|
||||
),
|
||||
);
|
||||
break;
|
||||
default:
|
||||
throw TestFailure("HandlePositionInViewport can't be null.");
|
||||
}
|
||||
}
|
||||
expect(state.selectionOverlay!.handlesAreVisible, isTrue);
|
||||
@@ -4488,8 +4486,6 @@ void main() {
|
||||
),
|
||||
);
|
||||
break;
|
||||
default:
|
||||
throw TestFailure("HandlePositionInViewport can't be null.");
|
||||
}
|
||||
}
|
||||
expect(state.selectionOverlay!.handlesAreVisible, isTrue);
|
||||
|
||||
@@ -110,20 +110,21 @@ class AttachCommand extends FlutterCommand {
|
||||
final String name = 'attach';
|
||||
|
||||
@override
|
||||
final String description = '''Attach to a running app.
|
||||
final String description = '''
|
||||
Attach to a running app.
|
||||
|
||||
For attaching to Android or iOS devices, simply using `flutter attach` is
|
||||
usually sufficient. The tool will search for a running Flutter app or module,
|
||||
if available. Otherwise, the tool will wait for the next Flutter app or module
|
||||
to launch before attaching.
|
||||
For attaching to Android or iOS devices, simply using `flutter attach` is
|
||||
usually sufficient. The tool will search for a running Flutter app or module,
|
||||
if available. Otherwise, the tool will wait for the next Flutter app or module
|
||||
to launch before attaching.
|
||||
|
||||
For Fuchsia, the module name must be provided, e.g. `\$flutter attach
|
||||
--module=mod_name`. This can be called either before or after the application
|
||||
is started.
|
||||
For Fuchsia, the module name must be provided, e.g. `\$flutter attach
|
||||
--module=mod_name`. This can be called either before or after the application
|
||||
is started.
|
||||
|
||||
If the app or module is already running and the specific observatory port is
|
||||
known, it can be explicitly provided to attach via the command-line, e.g.
|
||||
`\$ flutter attach --debug-port 12345`''';
|
||||
If the app or module is already running and the specific observatory port is
|
||||
known, it can be explicitly provided to attach via the command-line, e.g.
|
||||
`\$ flutter attach --debug-port 12345`''';
|
||||
|
||||
int get debugPort {
|
||||
if (argResults['debug-port'] == null) {
|
||||
|
||||
@@ -1013,16 +1013,14 @@ String _validateProjectDir(String dirPath, { String flutterRoot, bool overwrite
|
||||
|
||||
final FileSystemEntityType type = globals.fs.typeSync(dirPath);
|
||||
|
||||
if (type != FileSystemEntityType.notFound) {
|
||||
switch (type) {
|
||||
case FileSystemEntityType.file:
|
||||
// Do not overwrite files.
|
||||
return "Invalid project name: '$dirPath' - file exists.";
|
||||
case FileSystemEntityType.link:
|
||||
// Do not overwrite links.
|
||||
return "Invalid project name: '$dirPath' - refers to a link.";
|
||||
}
|
||||
switch (type) {
|
||||
case FileSystemEntityType.file:
|
||||
// Do not overwrite files.
|
||||
return "Invalid project name: '$dirPath' - file exists.";
|
||||
case FileSystemEntityType.link:
|
||||
// Do not overwrite links.
|
||||
return "Invalid project name: '$dirPath' - refers to a link.";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -268,13 +268,11 @@ class IdeConfigCommand extends FlutterCommand {
|
||||
String _validateFlutterDir(String dirPath, { String flutterRoot }) {
|
||||
final FileSystemEntityType type = globals.fs.typeSync(dirPath);
|
||||
|
||||
if (type != FileSystemEntityType.notFound) {
|
||||
switch (type) {
|
||||
case FileSystemEntityType.link:
|
||||
// Do not overwrite links.
|
||||
return "Invalid project root dir: '$dirPath' - refers to a link.";
|
||||
}
|
||||
switch (type) {
|
||||
case FileSystemEntityType.link:
|
||||
// Do not overwrite links.
|
||||
return "Invalid project root dir: '$dirPath' - refers to a link.";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -223,30 +223,34 @@ Future<@(class)> @(lookupName)(Locale locale) {
|
||||
return null;
|
||||
}''';
|
||||
|
||||
const String lookupBodyTemplate = '''@(lookupAllCodesSpecified)
|
||||
@(lookupScriptCodeSpecified)
|
||||
@(lookupCountryCodeSpecified)
|
||||
@(lookupLanguageCodeSpecified)''';
|
||||
const String lookupBodyTemplate = '''
|
||||
@(lookupAllCodesSpecified)
|
||||
@(lookupScriptCodeSpecified)
|
||||
@(lookupCountryCodeSpecified)
|
||||
@(lookupLanguageCodeSpecified)''';
|
||||
|
||||
const String switchClauseTemplate = '''case '@(case)': return @(localeClass)();''';
|
||||
|
||||
const String switchClauseDeferredLoadingTemplate = '''case '@(case)': return @(library).loadLibrary().then((dynamic _) => @(library).@(localeClass)());''';
|
||||
|
||||
const String nestedSwitchTemplate = '''case '@(languageCode)': {
|
||||
switch (locale.@(code)) {
|
||||
@(switchClauses)
|
||||
}
|
||||
break;
|
||||
}''';
|
||||
|
||||
const String languageCodeSwitchTemplate = '''@(comment)
|
||||
switch (locale.languageCode) {
|
||||
const String nestedSwitchTemplate = '''
|
||||
case '@(languageCode)': {
|
||||
switch (locale.@(code)) {
|
||||
@(switchClauses)
|
||||
}
|
||||
break;
|
||||
}''';
|
||||
|
||||
const String languageCodeSwitchTemplate = '''
|
||||
@(comment)
|
||||
switch (locale.languageCode) {
|
||||
@(switchClauses)
|
||||
}
|
||||
''';
|
||||
|
||||
const String allCodesLookupTemplate = '''// Lookup logic when language+script+country codes are specified.
|
||||
switch (locale.toString()) {
|
||||
@(allCodesSwitchClauses)
|
||||
}
|
||||
const String allCodesLookupTemplate = '''
|
||||
// Lookup logic when language+script+country codes are specified.
|
||||
switch (locale.toString()) {
|
||||
@(allCodesSwitchClauses)
|
||||
}
|
||||
''';
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
/// Cache of https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry.
|
||||
const String languageSubtagRegistry = '''File-Date: 2020-03-16
|
||||
const String languageSubtagRegistry = '''
|
||||
File-Date: 2020-03-16
|
||||
%%
|
||||
Type: language
|
||||
Subtag: aa
|
||||
|
||||
@@ -53,7 +53,8 @@ String generateMainModule({
|
||||
@required bool nullAssertions,
|
||||
}) {
|
||||
// TODO(jonahwilliams): fix typo in dwds and update.
|
||||
return '''/* ENTRYPOINT_EXTENTION_MARKER */
|
||||
return '''
|
||||
/* ENTRYPOINT_EXTENTION_MARKER */
|
||||
// Create the main module loaded below.
|
||||
define("main_module.bootstrap", ["$entrypoint", "dart_sdk"], function(app, dart_sdk) {
|
||||
dart_sdk.dart.setStartAsyncSynchronously(true);
|
||||
|
||||
@@ -382,14 +382,15 @@ set(BINARY_NAME "fizz_bar")
|
||||
ninjaCommand('release', onRun: () {
|
||||
fileSystem.file('build/flutter_size_01/snapshot.linux-x64.json')
|
||||
..createSync(recursive: true)
|
||||
..writeAsStringSync('''[
|
||||
{
|
||||
"l": "dart:_internal",
|
||||
"c": "SubListIterable",
|
||||
"n": "[Optimized] skip",
|
||||
"s": 2400
|
||||
}
|
||||
]''');
|
||||
..writeAsStringSync('''
|
||||
[
|
||||
{
|
||||
"l": "dart:_internal",
|
||||
"c": "SubListIterable",
|
||||
"n": "[Optimized] skip",
|
||||
"s": 2400
|
||||
}
|
||||
]''');
|
||||
fileSystem.file('build/flutter_size_01/trace.linux-x64.json')
|
||||
..createSync(recursive: true)
|
||||
..writeAsStringSync('{}');
|
||||
|
||||
@@ -347,14 +347,15 @@ void main() {
|
||||
setUpMockXcodeBuildHandler('Release', onRun: () {
|
||||
fileSystem.file('build/flutter_size_01/snapshot.x86_64.json')
|
||||
..createSync(recursive: true)
|
||||
..writeAsStringSync('''[
|
||||
{
|
||||
"l": "dart:_internal",
|
||||
"c": "SubListIterable",
|
||||
"n": "[Optimized] skip",
|
||||
"s": 2400
|
||||
}
|
||||
]''');
|
||||
..writeAsStringSync('''
|
||||
[
|
||||
{
|
||||
"l": "dart:_internal",
|
||||
"c": "SubListIterable",
|
||||
"n": "[Optimized] skip",
|
||||
"s": 2400
|
||||
}
|
||||
]''');
|
||||
fileSystem.file('build/flutter_size_01/trace.x86_64.json')
|
||||
..createSync(recursive: true)
|
||||
..writeAsStringSync('{}');
|
||||
|
||||
@@ -195,7 +195,8 @@ void main() {
|
||||
// edited down for compactness. For instance, where similar lines are
|
||||
// repeated in actual output, one or two representative lines are chosen
|
||||
// to be included here.
|
||||
const String stdout = r'''Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Framework
|
||||
const String stdout = r'''
|
||||
Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Framework
|
||||
Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
|
||||
Checking Build System
|
||||
@@ -227,7 +228,8 @@ C:\foo\windows\runner\main.cpp(17,1): error C2065: 'Baz': undeclared identifier
|
||||
const <String>['windows', '--no-pub']
|
||||
);
|
||||
// Just the warnings and errors should be surfaced.
|
||||
expect(testLogger.errorText, r'''C:\foo\windows\runner\main.cpp(18): error C2220: the following warning is treated as an error [C:\foo\build\windows\runner\test.vcxproj]
|
||||
expect(testLogger.errorText, r'''
|
||||
C:\foo\windows\runner\main.cpp(18): error C2220: the following warning is treated as an error [C:\foo\build\windows\runner\test.vcxproj]
|
||||
C:\foo\windows\runner\main.cpp(18): warning C4706: assignment within conditional expression [C:\foo\build\windows\runner\test.vcxproj]
|
||||
main.obj : error LNK2019: unresolved external symbol "void __cdecl Bar(void)" (?Bar@@YAXXZ) referenced in function wWinMain [C:\foo\build\windows\runner\test.vcxproj]
|
||||
C:\foo\build\windows\runner\Debug\test.exe : fatal error LNK1120: 1 unresolved externals [C:\foo\build\windows\runner\test.vcxproj]
|
||||
@@ -381,14 +383,15 @@ C:\foo\windows\runner\main.cpp(17,1): error C2065: 'Baz': undeclared identifier
|
||||
buildCommand('Release', onRun: () {
|
||||
fileSystem.file(r'build\flutter_size_01\snapshot.windows-x64.json')
|
||||
..createSync(recursive: true)
|
||||
..writeAsStringSync('''[
|
||||
{
|
||||
"l": "dart:_internal",
|
||||
"c": "SubListIterable",
|
||||
"n": "[Optimized] skip",
|
||||
"s": 2400
|
||||
}
|
||||
]''');
|
||||
..writeAsStringSync('''
|
||||
[
|
||||
{
|
||||
"l": "dart:_internal",
|
||||
"c": "SubListIterable",
|
||||
"n": "[Optimized] skip",
|
||||
"s": 2400
|
||||
}
|
||||
]''');
|
||||
fileSystem.file(r'build\flutter_size_01\trace.windows-x64.json')
|
||||
..createSync(recursive: true)
|
||||
..writeAsStringSync('{}');
|
||||
|
||||
@@ -204,14 +204,15 @@ void main() {
|
||||
setUpMockXcodeBuildHandler(onRun: () {
|
||||
fileSystem.file('build/flutter_size_01/snapshot.arm64.json')
|
||||
..createSync(recursive: true)
|
||||
..writeAsStringSync('''[
|
||||
{
|
||||
"l": "dart:_internal",
|
||||
"c": "SubListIterable",
|
||||
"n": "[Optimized] skip",
|
||||
"s": 2400
|
||||
}
|
||||
]''');
|
||||
..writeAsStringSync('''
|
||||
[
|
||||
{
|
||||
"l": "dart:_internal",
|
||||
"c": "SubListIterable",
|
||||
"n": "[Optimized] skip",
|
||||
"s": 2400
|
||||
}
|
||||
]''');
|
||||
fileSystem.file('build/flutter_size_01/trace.arm64.json')
|
||||
..createSync(recursive: true)
|
||||
..writeAsStringSync('{}');
|
||||
|
||||
@@ -16,7 +16,8 @@ void main() {
|
||||
final MemoryFileSystem fileSystem = MemoryFileSystem.test();
|
||||
final File arbFile = fileSystem.file(fileSystem.path.join('lib', 'l10n', 'app_en.arb'))
|
||||
..createSync(recursive: true);
|
||||
arbFile.writeAsStringSync('''{
|
||||
arbFile.writeAsStringSync('''
|
||||
{
|
||||
"helloWorld": "Hello, World!",
|
||||
"@helloWorld": {
|
||||
"description": "Sample description"
|
||||
@@ -52,7 +53,8 @@ void main() {
|
||||
'app_en.arb',
|
||||
)..createSync(recursive: true);
|
||||
|
||||
arbFile.writeAsStringSync('''{
|
||||
arbFile.writeAsStringSync('''
|
||||
{
|
||||
"helloWorld": "Hello, World!",
|
||||
"@helloWorld": {
|
||||
"description": "Sample description"
|
||||
@@ -85,7 +87,8 @@ void main() {
|
||||
final MemoryFileSystem fileSystem = MemoryFileSystem.test();
|
||||
final File arbFile = fileSystem.file(fileSystem.path.join('lib', 'l10n', 'app_en.arb'))
|
||||
..createSync(recursive: true);
|
||||
arbFile.writeAsStringSync('''{
|
||||
arbFile.writeAsStringSync('''
|
||||
{
|
||||
"helloWorld": "Hello, World!",
|
||||
"@helloWorld": {
|
||||
"description": "Sample description"
|
||||
|
||||
@@ -75,7 +75,8 @@ void main() {
|
||||
} else {
|
||||
flutterRootUri.write(canonicalizedFlutterRootPath);
|
||||
}
|
||||
final String dotPackagesSrc = '''# Generated
|
||||
final String dotPackagesSrc = '''
|
||||
# Generated
|
||||
flutter:$flutterRootUri/packages/flutter/lib/
|
||||
sky_engine:$flutterRootUri/bin/cache/pkg/sky_engine/lib/
|
||||
flutter_project:lib/
|
||||
|
||||
@@ -1457,13 +1457,14 @@ plugin1=${plugin1.path}
|
||||
|
||||
fileSystem.file('foo/snapshot.arm64-v8a.json')
|
||||
..createSync(recursive: true)
|
||||
..writeAsStringSync(r'''[
|
||||
{
|
||||
"l": "dart:_internal",
|
||||
"c": "SubListIterable",
|
||||
"n": "[Optimized] skip",
|
||||
"s": 2400
|
||||
}
|
||||
..writeAsStringSync(r'''
|
||||
[
|
||||
{
|
||||
"l": "dart:_internal",
|
||||
"c": "SubListIterable",
|
||||
"n": "[Optimized] skip",
|
||||
"s": 2400
|
||||
}
|
||||
]''');
|
||||
fileSystem.file('foo/trace.arm64-v8a.json')
|
||||
..createSync(recursive: true)
|
||||
|
||||
@@ -12,7 +12,8 @@ import 'package:mockito/mockito.dart';
|
||||
|
||||
import '../../src/common.dart';
|
||||
|
||||
const String aotSizeOutput = '''[
|
||||
const String aotSizeOutput = '''
|
||||
[
|
||||
{
|
||||
"l": "dart:_internal",
|
||||
"c": "SubListIterable",
|
||||
|
||||
@@ -1319,7 +1319,8 @@ void main() {
|
||||
testUsingContext('ResidentRunner can run source generation', () => testbed.run(() async {
|
||||
final File arbFile = globals.fs.file(globals.fs.path.join('lib', 'l10n', 'app_en.arb'))
|
||||
..createSync(recursive: true);
|
||||
arbFile.writeAsStringSync('''{
|
||||
arbFile.writeAsStringSync('''
|
||||
{
|
||||
"helloWorld": "Hello, World!",
|
||||
"@helloWorld": {
|
||||
"description": "Sample description"
|
||||
@@ -1339,7 +1340,8 @@ void main() {
|
||||
// to app_en.arb.
|
||||
final File arbFile = globals.fs.file(globals.fs.path.join('lib', 'l10n', 'foo.arb'))
|
||||
..createSync(recursive: true);
|
||||
arbFile.writeAsStringSync('''{
|
||||
arbFile.writeAsStringSync('''
|
||||
{
|
||||
"helloWorld": "Hello, World!",
|
||||
"@helloWorld": {
|
||||
"description": "Sample description"
|
||||
|
||||
@@ -36,8 +36,8 @@ void main() {
|
||||
nullAssertions: true,
|
||||
);
|
||||
|
||||
expect(result, contains(
|
||||
''' if (true) {
|
||||
expect(result, contains('''
|
||||
if (true) {
|
||||
dart_sdk.dart.nonNullAsserts(true);'''));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user