Roll dart_style 2.0.1 into the SDK.

This pins to https://github.com/dart-lang/dart_style/pull/1016.

Change-Id: Ia7b297a03eff00c68bf76bbfd206cf88d800a92c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193961
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
This commit is contained in:
Johnni Winther 2021-04-06 14:32:37 +00:00 committed by commit-bot@chromium.org
parent c739b324a6
commit f0ccceab4d
29 changed files with 234 additions and 17 deletions

View file

@ -11,7 +11,7 @@
"constraint, update this by running tools/generate_package_config.dart."
],
"configVersion": 2,
"generated": "2021-04-05T08:58:24.237896",
"generated": "2021-04-06T14:39:06.316531",
"generator": "tools/generate_package_config.dart",
"packages": [
{

View file

@ -80,6 +80,13 @@
- unused_import
```
#### dart format
* Flatten indentation on nested chains of conditional (`?:`) operators.
* Correct constructor initializer indentation after `required` named
parameters.
#### Linter
Updated the Linter to `1.2.1`, which includes:

4
DEPS
View file

@ -98,7 +98,7 @@ vars = {
# and land the review.
#
# For more details, see https://github.com/dart-lang/sdk/issues/30164
"dart_style_tag": "2cf810073e0cc7e7ea05d3de51830e6fa6d62924",
"dart_style_rev": "0067cfcc5bfa64cf59888c3fed34c71d1272555a",
"chromedriver_tag": "83.0.4103.39",
"browser_launcher_rev": "12ab9f351a44ac803de9bc17bb2180bb312a9dd7",
@ -331,7 +331,7 @@ deps = {
Var("dart_root") + "/third_party/pkg/csslib":
Var("dart_git") + "csslib.git" + "@" + Var("csslib_rev"),
Var("dart_root") + "/third_party/pkg_tested/dart_style":
Var("dart_git") + "dart_style.git" + "@" + Var("dart_style_tag"),
Var("dart_git") + "dart_style.git" + "@" + Var("dart_style_rev"),
Var("dart_root") + "/third_party/pkg/dart2js_info":
Var("dart_git") + "dart2js_info.git" + "@" + Var("dart2js_info_rev"),
Var("dart_root") + "/third_party/pkg/dartdoc":

View file

@ -1,7 +1,10 @@
class MyClass {
final int a;
final int b;
const MyClass(i1, i2) : a = (i1 >>> i2), b = (i1 >>> i2);
const MyClass(i1, i2)
: a = (i1 >>> i2),
b = (i1 >>> i2);
}
test() {}
main() {}

View file

@ -0,0 +1,10 @@
class MyClass {
const MyClass(i1, i2)
: a = (i1 >>> i2),
b = (i1 >>> i2);
final int a;
final int b;
}
main() {}
test() {}

View file

@ -8,9 +8,11 @@ const dynamic d0 = 1 >> a;
const dynamic d1 = 1 >> b;
const dynamic d2 = 1 >>> a;
const dynamic d3 = 1 >>> b;
class Class {
final int a;
const Class.doubleShift(i1, i2) : a = (i1 >> i2);
const Class.tripleShift(i1, i2) : a = (i1 >>> i2);
}
main() {}

View file

@ -0,0 +1,17 @@
class Class {
const Class.doubleShift(i1, i2) : a = (i1 >> i2);
const Class.tripleShift(i1, i2) : a = (i1 >>> i2);
final int a;
}
const dynamic a = 1.0;
const dynamic b = 1.5;
const dynamic c0 = a >> 1;
const dynamic c1 = b >> 1;
const dynamic c2 = a >>> 1;
const dynamic c3 = b >>> 1;
const dynamic d0 = 1 >> a;
const dynamic d1 = 1 >> b;
const dynamic d2 = 1 >>> a;
const dynamic d3 = 1 >>> b;
main() {}

View file

@ -1,4 +1,5 @@
class A<T> {}
typedef B<X extends A<X>> = A<X>;
foo() {}
B<A<int>> bar1a() => throw 42;
@ -7,16 +8,19 @@ bar2a(B<A<int>> x) => throw 42;
bar2b(A<B<A<int>>> x) => throw 42;
bar3a<X extends B<A<int>>>() => throw 42;
bar3b<X extends A<B<A<int>>>>() => throw 42;
class Bar1<X extends B<A<int>>> {
B<A<int>> barBar11() => throw 42;
barBar12(B<A<int>> x) => throw 42;
barBar13<X extends B<A<int>>>() => throw 42;
}
class Bar2<X extends A<B<A<int>>>> {
A<B<A<int>>> barBar21() => throw 42;
barBar22(A<B<A<int>>> x) => throw 42;
barBar23<X extends A<B<A<int>>>>() => throw 42;
}
typedef Baz1 = B<A<int>>;
typedef Baz2 = A<B<A<int>>>;
main() {}

View file

@ -0,0 +1,26 @@
A<B<A<int>>> bar1b() => throw 42;
B<A<int>> bar1a() => throw 42;
bar2a(B<A<int>> x) => throw 42;
bar2b(A<B<A<int>>> x) => throw 42;
bar3a<X extends B<A<int>>>() => throw 42;
bar3b<X extends A<B<A<int>>>>() => throw 42;
class A<T> {}
class Bar1<X extends B<A<int>>> {
B<A<int>> barBar11() => throw 42;
barBar12(B<A<int>> x) => throw 42;
barBar13<X extends B<A<int>>>() => throw 42;
}
class Bar2<X extends A<B<A<int>>>> {
A<B<A<int>>> barBar21() => throw 42;
barBar22(A<B<A<int>>> x) => throw 42;
barBar23<X extends A<B<A<int>>>>() => throw 42;
}
foo() {}
main() {}
typedef B<X extends A<X>> = A<X>;
typedef Baz1 = B<A<int>>;
typedef Baz2 = A<B<A<int>>>;

View file

@ -0,0 +1,5 @@
foo() {}
main() {}
typedef A<X extends int> = B<String>;
typedef B<X extends int> = C<String>;
typedef C<X extends int> = X;

View file

@ -1,5 +1,6 @@
import 'dart:async';
import 'issue41501_lib.dart';
typedef AAliasNonNullable = A;
typedef AAliasNullable = A?;
test() {}

View file

@ -0,0 +1,7 @@
import 'dart:async';
import 'issue41501_lib.dart';
main() {}
test() {}
typedef AAliasNonNullable = A;
typedef AAliasNullable = A?;

View file

@ -1,8 +1,11 @@
class A<X extends A<X>> {}
typedef B<X extends A<X>> = A<X>;
class A2<X extends A2<X>> {
factory A2() => throw 42;
}
typedef B2<X extends A2<X>> = A2<X>;
foo() {}
main() {}

View file

@ -0,0 +1,10 @@
class A<X extends A<X>> {}
class A2<X extends A2<X>> {
factory A2() => throw 42;
}
foo() {}
main() {}
typedef B<X extends A<X>> = A<X>;
typedef B2<X extends A2<X>> = A2<X>;

View file

@ -2,9 +2,12 @@ class A {
factory A() = BAlias;
factory A.named() = BAlias.named;
}
typedef BAlias = B;
class B implements A {
B();
B.named();
}
main() {}

View file

@ -0,0 +1,12 @@
class A {
factory A() = BAlias;
factory A.named() = BAlias.named;
}
class B implements A {
B();
B.named();
}
main() {}
typedef BAlias = B;

View file

@ -1,15 +1,20 @@
Type? _capturedTypeArgument;
X captureTypeArgument<X>() {}
class A<X extends A<X>> {}
typedef C<X extends A<X>> = A<X>;
void topLevel1<X extends A<X>>(A<X> Function() g) => g();
void topLevel2<X extends C<X>>(C<X> Function() g) => g();
class Class {
void instance1<X extends A<X>>(A<X> Function() g) => g();
void instance2<X extends C<X>>(C<X> Function() g) => g();
void test() {}
}
class Subclass extends Class {
void test() {}
}
main() {}

View file

@ -0,0 +1,19 @@
Type? _capturedTypeArgument;
X captureTypeArgument<X>() {}
class A<X extends A<X>> {}
class Class {
void instance1<X extends A<X>>(A<X> Function() g) => g();
void instance2<X extends C<X>>(C<X> Function() g) => g();
void test() {}
}
class Subclass extends Class {
void test() {}
}
main() {}
typedef C<X extends A<X>> = A<X>;
void topLevel1<X extends A<X>>(A<X> Function() g) => g();
void topLevel2<X extends C<X>>(C<X> Function() g) => g();

View file

@ -1,3 +1,4 @@
class A<X extends A<X>> {}
typedef AAlias<X> = A;
void main() {}

View file

@ -0,0 +1,4 @@
class A<X extends A<X>> {}
typedef AAlias<X> = A;
void main() {}

View file

@ -1,4 +1,5 @@
class C<X> {}
typedef G<X> = X Function(X);
typedef A<X extends G<C<X>>> = C<X>;
test() {}

View file

@ -0,0 +1,6 @@
class C<X> {}
main() {}
test() {}
typedef A<X extends G<C<X>>> = C<X>;
typedef G<X> = X Function(X);

View file

@ -3,11 +3,13 @@ class C<X> {
C.foo() {}
factory C.bar() = C;
}
class D<X> {
D();
factory D.foo() => new D();
factory D.bar() = D;
}
typedef G<X> = X Function(X);
typedef A<X extends G<C<X>>> = C<X>;
typedef B<X extends G<D<X>>> = D<X>;

View file

@ -0,0 +1,17 @@
class C<X> {
C.foo() {}
factory C() => new C.foo();
factory C.bar() = C;
}
class D<X> {
D();
factory D.bar() = D;
factory D.foo() => new D();
}
main() {}
test() {}
typedef A<X extends G<C<X>>> = C<X>;
typedef B<X extends G<D<X>>> = D<X>;
typedef G<X> = X Function(X);

View file

@ -1,26 +1,42 @@
import 'nullable_supertypes.dart' as prefix;
class A {}
class B {}
class C {}
typedef AAlias = A?;
typedef BAlias = B?;
typedef CAlias = C?;
typedef TAlias<T> = T?;
class C1 extends AAlias {}
class C2 implements AAlias {}
class C3 = A with BAlias;
class C4 = A with B implements CAlias;
class C5 extends A with BAlias {}
mixin M1 on AAlias {}
mixin M2 on A, BAlias {}
mixin M3 on A implements BAlias {}
class D1 extends TAlias<A> {}
class D1a extends prefix.TAlias<A> {}
class D1b extends TAlias<prefix.A> {}
class D2 implements TAlias<A> {}
class D3 = A with TAlias<B>;
class D4 = A with B implements TAlias<C>;
class D5 extends A with TAlias<B> {}
mixin N1 on TAlias<A> {}
mixin N1a on prefix.TAlias<A> {}
mixin N1b on TAlias<prefix.A> {}

View file

@ -0,0 +1,43 @@
import 'nullable_supertypes.dart' as prefix;
class A {}
class B {}
class C {}
class C1 extends AAlias {}
class C2 implements AAlias {}
class C3 = A with BAlias;
class C4 = A with B implements CAlias;
class C5 extends A with BAlias {}
class D1 extends TAlias<A> {}
class D1a extends prefix.TAlias<A> {}
class D1b extends TAlias<prefix.A> {}
class D2 implements TAlias<A> {}
class D3 = A with TAlias<B>;
class D4 = A with B implements TAlias<C>;
class D5 extends A with TAlias<B> {}
main() {}
mixin M1 on AAlias {}
mixin M2 on A, BAlias {}
mixin M3 on A implements BAlias {}
mixin N1 on TAlias<A> {}
mixin N1a on prefix.TAlias<A> {}
mixin N1b on TAlias<prefix.A> {}
mixin N2 on A, TAlias<B> {}
mixin N3 on A implements TAlias<B> {}
typedef AAlias = A?;
typedef BAlias = B?;
typedef CAlias = C?;
typedef TAlias<T> = T?;

View file

@ -1,4 +1,5 @@
class C<X> {}
typedef A<X extends num, Y> = C<X>;
foo() {}
main() {}

View file

@ -0,0 +1,5 @@
class C<X> {}
foo() {}
main() {}
typedef A<X extends num, Y> = C<X>;

View file

@ -30,10 +30,8 @@ general/annotation_eof: FormatterCrash
general/bad_setter_abstract: FormatterCrash
general/bug31124: FormatterCrash
general/clone_function_type: FormatterCrash
general/constants/js_semantics/issue45376: FormatterCrash
general/constants/js_semantics/number_folds: FormatterCrash
general/constants/js_semantics/number_folds_opt_out: FormatterCrash
general/constants/js_semantics/on_double: FormatterCrash
general/constants/number_folds: FormatterCrash
general/constants/number_folds_opt_out: FormatterCrash
general/constants/various: FormatterCrash
@ -129,18 +127,7 @@ nnbd/uninitialized_non_nullable_late_fields: FormatterCrash
nnbd_mixed/inheritance_from_opt_in: FormatterCrash
nnbd_mixed/issue41597: FormatterCrash
nnbd_mixed/null_safety_invalid_language_version: FormatterCrash
nonfunction_type_aliases/aliased_checks: FormatterCrash
nonfunction_type_aliases/aliased_checks_in_typedef: FormatterCrash
nonfunction_type_aliases/issue41501: FormatterCrash
nonfunction_type_aliases/issue42446: FormatterCrash
nonfunction_type_aliases/issue45051: FormatterCrash
nonfunction_type_aliases/issue45464: FormatterCrash
nonfunction_type_aliases/issue45491: FormatterCrash
nonfunction_type_aliases/issue45519: FormatterCrash
nonfunction_type_aliases/issue45519_2: FormatterCrash
nonfunction_type_aliases/nullable_supertypes: FormatterCrash
nonfunction_type_aliases/old_version: FormatterCrash
nonfunction_type_aliases/unaliased_bounds_checks_in_constructor_calls: FormatterCrash
rasta/bad_redirection: FormatterCrash
rasta/issue_000032: FormatterCrash
rasta/issue_000034: FormatterCrash