[go: nahoru, domu]

Skip to content

Commit

Permalink
enable combinators_ordering (flutter#107847)
Browse files Browse the repository at this point in the history
  • Loading branch information
a14n committed Jul 18, 2022
1 parent 891777d commit ccd3363
Show file tree
Hide file tree
Showing 87 changed files with 177 additions and 143 deletions.
5 changes: 4 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ linter:
# - cascade_invocations # doesn't match the typical style of this repo
- cast_nullable_to_non_nullable
# - close_sinks # not reliable enough
- combinators_ordering
# - comment_references # blocked on https://github.com/dart-lang/linter/issues/1142
# - conditional_uri_does_not_exist # not yet tested
# - constant_identifier_names # needs an opt-out https://github.com/dart-lang/linter/issues/204
Expand All @@ -103,6 +104,7 @@ linter:
- deprecated_consistency
# - diagnostic_describe_all_properties # enabled only at the framework level (packages/flutter/lib)
- directives_ordering
# - discarded_futures # not yet tested
# - do_not_use_environment # there are appropriate times to use the environment, especially in our tests and build logic
- empty_catches
- empty_constructor_bodies
Expand All @@ -113,7 +115,6 @@ linter:
- flutter_style_todos
- hash_and_equals
- implementation_imports
# - invariant_booleans # too many false positives: https://github.com/dart-lang/linter/issues/811
- iterable_contains_unrelated_type
# - join_return_with_assignment # not required by flutter style
- leading_newlines_in_multiline_strings
Expand Down Expand Up @@ -211,6 +212,7 @@ linter:
- unnecessary_late
- unnecessary_new
- unnecessary_null_aware_assignments
- unnecessary_null_aware_operator_on_extension_on_nullable
- unnecessary_null_checks
- unnecessary_null_in_if_null_operators
- unnecessary_nullable_for_final_variable_declarations
Expand All @@ -221,6 +223,7 @@ linter:
- unnecessary_string_escapes
- unnecessary_string_interpolations
- unnecessary_this
- unnecessary_to_list_in_spreads
- unrelated_type_equality_checks
- unsafe_html
- use_build_context_synchronously
Expand Down
2 changes: 1 addition & 1 deletion dev/benchmarks/test_apps/stocks/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ library stocks;

import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart' show
debugPaintSizeEnabled,
debugPaintBaselinesEnabled,
debugPaintLayerBordersEnabled,
debugPaintPointersEnabled,
debugPaintSizeEnabled,
debugRepaintRainbowEnabled;

import 'i18n/stock_strings.dart';
Expand Down
2 changes: 1 addition & 1 deletion dev/benchmarks/test_apps/stocks/lib/stock_home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import 'package:flutter/gestures.dart' show DragStartBehavior;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart' show debugDumpRenderTree, debugDumpLayerTree, debugDumpSemanticsTree, DebugSemanticsDumpOrder;
import 'package:flutter/rendering.dart' show DebugSemanticsDumpOrder, debugDumpLayerTree, debugDumpRenderTree, debugDumpSemanticsTree;
import 'package:flutter/scheduler.dart' show timeDilation;

import 'i18n/stock_strings.dart';
Expand Down
2 changes: 1 addition & 1 deletion dev/bots/prepare_package.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import 'package:crypto/crypto.dart';
import 'package:crypto/src/digest_sink.dart';
import 'package:http/http.dart' as http;
import 'package:path/path.dart' as path;
import 'package:platform/platform.dart' show Platform, LocalPlatform;
import 'package:platform/platform.dart' show LocalPlatform, Platform;
import 'package:process/process.dart';

const String gobMirror =
Expand Down
2 changes: 1 addition & 1 deletion dev/bots/unpublish_package.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import 'dart:io' hide Platform;

import 'package:args/args.dart';
import 'package:path/path.dart' as path;
import 'package:platform/platform.dart' show Platform, LocalPlatform;
import 'package:platform/platform.dart' show LocalPlatform, Platform;
import 'package:process/process.dart';

const String gsBase = 'gs://flutter_infra_release';
Expand Down
2 changes: 1 addition & 1 deletion dev/devicelab/lib/framework/browser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// found in the LICENSE file.

import 'dart:async';
import 'dart:convert' show json, utf8, LineSplitter, JsonEncoder;
import 'dart:convert' show JsonEncoder, LineSplitter, json, utf8;
import 'dart:io' as io;
import 'dart:math' as math;

Expand Down
2 changes: 1 addition & 1 deletion dev/devicelab/lib/tasks/entrypoint_dart_registrant.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import 'dart:async';
import 'dart:convert';
import 'dart:io' show Process, ProcessSignal, Directory, File;
import 'dart:io' show Directory, File, Process, ProcessSignal;

import '../framework/devices.dart';
import '../framework/framework.dart';
Expand Down
2 changes: 1 addition & 1 deletion dev/devicelab/lib/tasks/platform_channels_benchmarks.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.

import 'dart:io' show Process, Directory;
import 'dart:io' show Directory, Process;

import 'package:path/path.dart' as path;

Expand Down
2 changes: 1 addition & 1 deletion dev/tools/examples_smoke_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import 'dart:async';
import 'dart:convert';
import 'dart:io' show stdout, stderr, exitCode, Process, ProcessException;
import 'dart:io' show Process, ProcessException, exitCode, stderr, stdout;

import 'package:file/file.dart';
import 'package:file/local.dart';
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/painting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/// painting boxes.
library painting;

export 'dart:ui' show Shadow, PlaceholderAlignment, TextHeightBehavior, TextLeadingDistribution;
export 'dart:ui' show PlaceholderAlignment, Shadow, TextHeightBehavior, TextLeadingDistribution;

export 'src/painting/alignment.dart';
export 'src/painting/basic_types.dart';
Expand Down
4 changes: 2 additions & 2 deletions packages/flutter/lib/rendering.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
library rendering;

export 'package:flutter/foundation.dart' show
VoidCallback,
DiagnosticLevel,
ValueChanged,
ValueGetter,
ValueSetter,
DiagnosticLevel;
VoidCallback;
export 'package:flutter/semantics.dart';
export 'package:vector_math/vector_math_64.dart' show Matrix4;

Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/cupertino/colors.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.

import 'dart:ui' show Color, Brightness;
import 'dart:ui' show Brightness, Color;

import '../../foundation.dart';
import '../widgets/basic.dart';
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/cupertino/context_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'dart:math' as math;
import 'dart:ui' as ui;

import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart' show kMinFlingVelocity, kLongPressTimeout;
import 'package:flutter/gestures.dart' show kLongPressTimeout, kMinFlingVelocity;
import 'package:flutter/scheduler.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/cupertino/route.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// found in the LICENSE file.

import 'dart:math';
import 'dart:ui' show lerpDouble, ImageFilter;
import 'dart:ui' show ImageFilter, lerpDouble;

import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/cupertino/search_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'icons.dart';
import 'localizations.dart';
import 'text_field.dart';

export 'package:flutter/services.dart' show SmartQuotesType, SmartDashesType;
export 'package:flutter/services.dart' show SmartDashesType, SmartQuotesType;

/// A [CupertinoTextField] that mimics the look and behavior of UIKit's
/// `UISearchTextField`.
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/cupertino/text_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import 'icons.dart';
import 'text_selection.dart';
import 'theme.dart';

export 'package:flutter/services.dart' show TextInputType, TextInputAction, TextCapitalization, SmartQuotesType, SmartDashesType;
export 'package:flutter/services.dart' show SmartDashesType, SmartQuotesType, TextCapitalization, TextInputAction, TextInputType;

const TextStyle _kDefaultPlaceholderStyle = TextStyle(
fontWeight: FontWeight.w400,
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/foundation/binding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import 'dart:convert' show json;
import 'dart:developer' as developer;
import 'dart:io' show exit;
import 'dart:ui' as ui show SingletonFlutterWindow, Brightness, PlatformDispatcher, window;
import 'dart:ui' as ui show Brightness, PlatformDispatcher, SingletonFlutterWindow, window;
// Before adding any more dart:ui imports, please read the README.

import 'package:meta/meta.dart';
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/gestures/converter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// found in the LICENSE file.


import 'dart:ui' as ui show PointerData, PointerChange, PointerSignalKind;
import 'dart:ui' as ui show PointerChange, PointerData, PointerSignalKind;

import 'events.dart';

Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/material/about.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.

import 'dart:developer' show Timeline, Flow;
import 'dart:developer' show Flow, Timeline;
import 'dart:io' show Platform;

import 'package:flutter/foundation.dart';
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/material/animated_icons.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
library material_animated_icons;

import 'dart:math' as math show pi;
import 'dart:ui' as ui show Paint, Path, Canvas;
import 'dart:ui' as ui show Canvas, Paint, Path;
import 'dart:ui' show lerpDouble;

import 'package:flutter/foundation.dart' show clampDouble;
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/material/text_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import 'selectable_text.dart' show iOSHorizontalOffset;
import 'text_selection.dart';
import 'theme.dart';

export 'package:flutter/services.dart' show TextInputType, TextInputAction, TextCapitalization, SmartQuotesType, SmartDashesType;
export 'package:flutter/services.dart' show SmartDashesType, SmartQuotesType, TextCapitalization, TextInputAction, TextInputType;

/// Signature for the [TextField.buildCounter] callback.
typedef InputCounterWidgetBuilder = Widget? Function(
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/material/text_form_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'input_decorator.dart';
import 'text_field.dart';
import 'theme.dart';

export 'package:flutter/services.dart' show SmartQuotesType, SmartDashesType;
export 'package:flutter/services.dart' show SmartDashesType, SmartQuotesType;

/// A [FormField] that contains a [TextField].
///
Expand Down
6 changes: 3 additions & 3 deletions packages/flutter/lib/src/painting/basic_types.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export 'dart:ui' show
Path,
PathFillType,
PathOperation,
Radius,
RRect,
RSTransform,
Radius,
Rect,
Shader,
Size,
Expand All @@ -43,8 +43,8 @@ export 'dart:ui' show
VertexMode,
// TODO(werainkhatri): remove these after their deprecation period in engine
// https://github.com/flutter/flutter/pull/99505
hashValues, // ignore: deprecated_member_use
hashList; // ignore: deprecated_member_use
hashList, // ignore: deprecated_member_use
hashValues; // ignore: deprecated_member_use

export 'package:flutter/foundation.dart' show VoidCallback;

Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/painting/binding.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.

import 'dart:ui' as ui show instantiateImageCodec, instantiateImageCodecFromBuffer, Codec, ImmutableBuffer;
import 'dart:ui' as ui show Codec, ImmutableBuffer, instantiateImageCodec, instantiateImageCodecFromBuffer;
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart' show ServicesBinding;

Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/painting/clip.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.

import 'dart:ui' show Canvas, Clip, Path, Paint, Rect, RRect, VoidCallback;
import 'dart:ui' show Canvas, Clip, Paint, Path, RRect, Rect, VoidCallback;

/// Clip utilities used by [PaintingContext].
abstract class ClipContext {
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/painting/debug.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// found in the LICENSE file.

import 'dart:io';
import 'dart:ui' show Size, Picture, Image;
import 'dart:ui' show Image, Picture, Size;

import 'package:flutter/foundation.dart';

Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/painting/edge_insets.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.

import 'dart:ui' as ui show lerpDouble, WindowPadding;
import 'dart:ui' as ui show WindowPadding, lerpDouble;

import 'package:flutter/foundation.dart';

Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/painting/image_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import 'dart:async';
import 'dart:io';
import 'dart:ui' as ui show Codec, ImmutableBuffer;
import 'dart:ui' show Size, Locale, TextDirection;
import 'dart:ui' show Locale, Size, TextDirection;

import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/painting/image_stream.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// found in the LICENSE file.

import 'dart:async';
import 'dart:ui' as ui show Image, Codec, FrameInfo;
import 'dart:ui' as ui show Codec, FrameInfo, Image;

import 'package:flutter/foundation.dart';
import 'package:flutter/scheduler.dart';
Expand Down
14 changes: 12 additions & 2 deletions packages/flutter/lib/src/painting/text_painter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:math' show min, max;
import 'dart:ui' as ui show Paragraph, ParagraphBuilder, ParagraphConstraints, ParagraphStyle, PlaceholderAlignment, LineMetrics, TextHeightBehavior, TextStyle, BoxHeightStyle, BoxWidthStyle;
import 'dart:math' show max, min;
import 'dart:ui' as ui show
BoxHeightStyle,
BoxWidthStyle,
LineMetrics,
Paragraph,
ParagraphBuilder,
ParagraphConstraints,
ParagraphStyle,
PlaceholderAlignment,
TextHeightBehavior,
TextStyle;

import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/painting/text_span.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.

import 'dart:ui' as ui show ParagraphBuilder, Locale, StringAttribute, LocaleStringAttribute, SpellOutStringAttribute;
import 'dart:ui' as ui show Locale, LocaleStringAttribute, ParagraphBuilder, SpellOutStringAttribute, StringAttribute;

import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
Expand Down
11 changes: 10 additions & 1 deletion packages/flutter/lib/src/painting/text_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:ui' as ui show ParagraphStyle, TextStyle, StrutStyle, lerpDouble, Shadow, FontFeature, FontVariation, TextHeightBehavior, TextLeadingDistribution;
import 'dart:ui' as ui show
FontFeature,
FontVariation,
ParagraphStyle,
Shadow,
StrutStyle,
TextHeightBehavior,
TextLeadingDistribution,
TextStyle,
lerpDouble;

import 'package:flutter/foundation.dart';

Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/rendering/editable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import 'dart:collection';
import 'dart:math' as math;
import 'dart:ui' as ui show TextBox, BoxHeightStyle, BoxWidthStyle, PlaceholderAlignment, LineMetrics;
import 'dart:ui' as ui show BoxHeightStyle, BoxWidthStyle, LineMetrics, PlaceholderAlignment, TextBox;

import 'package:characters/characters.dart';
import 'package:flutter/foundation.dart';
Expand Down
15 changes: 14 additions & 1 deletion packages/flutter/lib/src/rendering/object.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,20 @@ import 'package:flutter/semantics.dart';
import 'debug.dart';
import 'layer.dart';

export 'package:flutter/foundation.dart' show FlutterError, InformationCollector, DiagnosticsNode, ErrorSummary, ErrorDescription, ErrorHint, DiagnosticsProperty, StringProperty, DoubleProperty, EnumProperty, FlagProperty, IntProperty, DiagnosticPropertiesBuilder;
export 'package:flutter/foundation.dart' show
DiagnosticPropertiesBuilder,
DiagnosticsNode,
DiagnosticsProperty,
DoubleProperty,
EnumProperty,
ErrorDescription,
ErrorHint,
ErrorSummary,
FlagProperty,
FlutterError,
InformationCollector,
IntProperty,
StringProperty;
export 'package:flutter/gestures.dart' show HitTestEntry, HitTestResult;
export 'package:flutter/painting.dart';

Expand Down
Loading

0 comments on commit ccd3363

Please sign in to comment.