Roll dart_style into the SDK.

This has two changes:

- Hide "--fix" in the help. The command is still fully supported, we
  just don't show it because we want to gradually migrate users to
  "dart fix".

- Remove support for the "interface", "final", and "sealed" modifiers
  on mixin declarations, since the proposal no longer supports those
  (and we need to remove them from the analyzer AST API).

There are no meaningful style changes, so there's no need to update the
pre-build SDK for this change.

Change-Id: I2357970e298a9be8f6f26efb5b922d40ee4fbb7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290020
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
This commit is contained in:
Robert Nystrom 2023-03-21 19:05:06 +00:00 committed by Commit Queue
parent 7e6e56b9b5
commit 5d858f01de
10 changed files with 38 additions and 46 deletions

2
DEPS
View file

@ -133,7 +133,7 @@ vars = {
# and land the review.
#
# For more details, see https://github.com/dart-lang/sdk/issues/30164.
"dart_style_rev": "a3f1b041f3c5045d1fee7f1129075d0ad6a4a96e", # disable rev_sdk_deps.dart
"dart_style_rev": "568333db2650e77c0f96ebc77969c9469cf514f0", # disable rev_sdk_deps.dart
"dartdoc_rev": "7fde7a4d61dd251a4e48bf85ccab34f28ec8da71",
"ffi_rev": "32f5eefea59d4461e8ab40e83f157e49d5abe0da",
"file_rev": "72a67c33f90bfb7e10057e286e06d2fe3baa4d98",

View file

@ -1,8 +1,7 @@
final mixin M1 {}
sealed mixin M2 {}
final
mixin M1 {}
sealed
mixin M2 {}
base class S {}
final class C extends S with M1, M2 {}
final class D = S with M1, M2;

View file

@ -1,6 +1,5 @@
final class A {}
abstract final class B {}
final mixin M {}
final
mixin M {}
final class C = Object with M;

View file

@ -1,31 +1,18 @@
final class FinalClass {}
final mixin FinalMixin {}
final
mixin FinalMixin {}
base class BaseClass extends FinalClass {}
sealed class SubtypeOfFinal extends FinalClass {}
class RegularClass {}
final mixin FinalMixin2 {}
final
mixin FinalMixin2 {}
class Extends extends FinalClass {}
class Implements implements FinalClass {}
mixin MixinImplements implements FinalMixin {}
class With with FinalMixin {}
class With2 with FinalMixin, FinalMixin2 {}
mixin On on FinalClass {}
class ExtendsExtends extends Extends {}
class Multiple extends BaseClass implements FinalMixin {}
class Multiple2 extends RegularClass implements FinalClass {}
class IndirectSubtype extends SubtypeOfFinal {}

View file

@ -1,17 +1,13 @@
import 'main_lib.dart';
final class ExtendsFinalClass extends A {}
final class ImplementsFinalClass implements A {}
final class ImplementsFinalMixin implements M {}
final class MixInFinalMixin with M {}
enum EnumImplementsFinalMixin implements M { x }
enum EnumMixInFinalMixin with M { x }
final mixin MixinOnA on A {}
final mixin MixinOnM on M {}
final mixin MixinOnAM on A, M {}
final
mixin MixinOnA on A {}
final
mixin MixinOnM on M {}
final
mixin MixinOnAM on A, M {}

View file

@ -1,6 +1,5 @@
interface class A {}
abstract interface class B {}
interface mixin M {}
interface
mixin M {}
interface class C = Object with M;

View file

@ -1,7 +1,6 @@
// @dart = 2.19
final class A {}
abstract final class B {}
final mixin M {}
final
mixin M {}
final class C = Object with M;

View file

@ -1,7 +1,6 @@
// @dart = 2.19
interface class A {}
abstract interface class B {}
interface mixin M {}
interface
mixin M {}
interface class C = Object with M;

View file

@ -1 +1,2 @@
sealed mixin M {}
sealed
mixin M {}

View file

@ -21,6 +21,19 @@ regress/issue_39035.crash: EmptyOutput
regress/issue_39091_2: EmptyOutput
regress/utf_16_le_content.crash: EmptyOutput
# TODO(rnystrom): These tests are using modifiers that are no longer valid on
# mixins. The formatter no longer allows them. When the tests are updated to no
# longer use those disallowed modifiers, the formatter crashes should be
# resolved.
class_modifiers/anonymous_mixin: FormatterCrash
class_modifiers/final/final_class_declaration: FormatterCrash
class_modifiers/final/final_subtype_not_base_final_sealed: FormatterCrash
class_modifiers/final/outside_library/main: FormatterCrash
class_modifiers/interface/interface_class_declaration: FormatterCrash
general/final_class_declaration: FormatterCrash
general/interface_class_declaration: FormatterCrash
sealed_class/sealed_mixin_declaration: FormatterCrash
class_modifiers/mixin/mixin_class_invalid_modifiers: FormatterCrash
const_functions/const_functions_const_ctor: FormatterCrash
const_functions/const_functions_const_ctor_error: FormatterCrash