Skip to content

Commit dfb1fc2

Browse files
authored
Always wrap Condition descriptions (#2260)
These will break across lines and they read more easily when wrapped with angle brackets, regardless of whether they are the top level of the literal.
1 parent d0dc833 commit dfb1fc2

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

pkgs/checks/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## 0.3.1-wip
22

3-
- Update min SDK constraint to 3.4.0.
3+
- Update min SDK constraint to 3.4.0.
4+
- Always wrap Condition descriptions in angle brackets.
45

56
## 0.3.0
67

pkgs/checks/lib/src/describe.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ Iterable<String> _prettyPrint(
6262
.toList();
6363
return prefixFirst("'", postfixLast("'", escaped));
6464
} else if (object is Condition) {
65-
final value = ['A value that:', ...describe(object)];
66-
return isTopLevel ? prefixFirst('<', postfixLast('>', value)) : value;
65+
return ['<A value that:', ...postfixLast('>', describe(object))];
6766
} else {
6867
final value = const LineSplitter().convert(object.toString());
6968
return isTopLevel ? prefixFirst('<', postfixLast('>', value)) : value;

pkgs/checks/test/extensions/iterable_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ void main() {
107107
.description
108108
.deepEquals([
109109
' contains, in order: [1,',
110-
' A value that:',
111-
' equals <2>]'
110+
' <A value that:',
111+
' equals <2>>]'
112112
]);
113113
});
114114
});

0 commit comments

Comments
 (0)