Roll dart_style 1.3.7 into the SDK.

The main reason is that this adds better help text when run from
`dart format`. But it includes a couple of other changes and fixes:

* Don't crash when non-ASCII whitespace is trimmed.
* Split all conditional expressions (`?:`) when they are nested.
* Handle `external` and `abstract` fields and variables.

Change-Id: I59326e693bfe538013cd23b58924461f60e8e908
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160981
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
This commit is contained in:
Robert Nystrom 2020-08-31 18:07:44 +00:00 committed by William Hesse
parent 58ff2d0fe0
commit 88b77feb73
8 changed files with 32 additions and 2 deletions

View file

@ -42,6 +42,12 @@
### Tools
#### dartfmt
* Don't crash when non-ASCII whitespace is trimmed.
* Split all conditional expressions (`?:`) when they are nested.
* Handle `external` and `abstract` fields and variables.
#### Linter
Updated the Linter to `0.1.118`, which includes:

2
DEPS
View file

@ -94,7 +94,7 @@ vars = {
# and land the review.
#
# For more details, see https://github.com/dart-lang/sdk/issues/30164
"dart_style_tag": "1.3.6", # Please see the note above before updating.
"dart_style_tag": "1.3.7", # Please see the note above before updating.
"chromedriver_tag": "83.0.4103.39",
"dartdoc_rev" : "291ebc50072746bc59ccab59115a298915218428",

View file

@ -22,7 +22,7 @@ void format() {
var result = p.runSync('format', ['--help']);
expect(result.exitCode, 0);
expect(result.stderr, isEmpty);
expect(result.stdout, contains('Idiomatically formats Dart source code.'));
expect(result.stdout, contains('Idiomatically format Dart source code.'));
expect(result.stdout,
contains('Usage: dart format [options...] <files or directories...>'));
});

View file

@ -3,6 +3,7 @@ abstract class A {
abstract final int finalInstanceField;
abstract covariant num covariantInstanceField;
}
mixin B {
abstract int instanceField;
abstract final int finalInstanceField;

View file

@ -6,4 +6,5 @@ abstract class A {
abstract covariant num cn;
abstract covariant var cx;
}
main() {}

View file

@ -0,0 +1,10 @@
abstract class A {
abstract covariant num cn;
abstract covariant var cx;
abstract final fx;
abstract final int fi;
abstract int i1, i2;
abstract var x;
}
main() {}

View file

@ -1,9 +1,11 @@
external int s1;
external final fx;
class A {
external int i1;
external covariant var cx;
external static int s1;
external static final fx;
}
main() {}

View file

@ -0,0 +1,10 @@
class A {
external covariant var cx;
external int i1;
external static final fx;
external static int s1;
}
external final fx;
external int s1;
main() {}