Skip to content

Commit 376650d

Browse files
committed
chore: switch formatting to pageWidth=100
1 parent 939eb1a commit 376650d

File tree

111 files changed

+714
-1731
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+714
-1731
lines changed
Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,4 @@
1-
# This file configures the static analysis results for your project (errors,
2-
# warnings, and lints).
3-
#
4-
# This enables the 'recommended' set of lints from `package:lints`.
5-
# This set helps identify many issues that may lead to problems when running
6-
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
7-
# style and format.
8-
#
9-
# If you want a smaller set of lints you can change this to specify
10-
# 'package:lints/core.yaml'. These are just the most critical lints
11-
# (the recommended set includes the core lints).
12-
# The core lints are also what is used by pub.dev for scoring packages.
13-
141
include: package:lints/recommended.yaml
152

16-
# Uncomment the following section to specify additional rules.
17-
18-
# linter:
19-
# rules:
20-
# - camel_case_types
21-
22-
# analyzer:
23-
# exclude:
24-
# - path/to/excluded/files/**
25-
26-
# For more information about the core and recommended set of lints, see
27-
# https://dart.dev/go/core-lints
28-
29-
# For additional information about configuring this file, see
30-
# https://dart.dev/guides/language/analysis-options
3+
formatter:
4+
page_width: 100

formats/dogs_cbor/lib/dogs_cbor.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ extension DogCborExtension on DogEngine {
3838
/// expected to be a base64 encoded string.
3939
T fromCborString<T>(String encoded,
4040
{IterableKind kind = IterableKind.none, Type? type, TypeTree? tree}) {
41-
return fromCbor<T>(base64Decode(encoded),
42-
kind: kind, type: type, tree: tree);
41+
return fromCbor<T>(base64Decode(encoded), kind: kind, type: type, tree: tree);
4342
}
4443
}
Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,4 @@
1-
# This file configures the static analysis results for your project (errors,
2-
# warnings, and lints).
3-
#
4-
# This enables the 'recommended' set of lints from `package:lints`.
5-
# This set helps identify many issues that may lead to problems when running
6-
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
7-
# style and format.
8-
#
9-
# If you want a smaller set of lints you can change this to specify
10-
# 'package:lints/core.yaml'. These are just the most critical lints
11-
# (the recommended set includes the core lints).
12-
# The core lints are also what is used by pub.dev for scoring packages.
13-
141
include: package:lints/recommended.yaml
152

16-
# Uncomment the following section to specify additional rules.
17-
18-
# linter:
19-
# rules:
20-
# - camel_case_types
21-
22-
# analyzer:
23-
# exclude:
24-
# - path/to/excluded/files/**
25-
26-
# For more information about the core and recommended set of lints, see
27-
# https://dart.dev/go/core-lints
28-
29-
# For additional information about configuring this file, see
30-
# https://dart.dev/guides/language/analysis-options
3+
formatter:
4+
page_width: 100

formats/dogs_toml/lib/dogs_toml.dart

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,25 @@ class TomlCodec extends DefaultNativeCodec {
2727
dynamic _baselineEncodeRec(dynamic obj) => switch (obj) {
2828
null => r"$null$",
2929
Iterable() => obj.map((e) => _baselineEncodeRec(e)).toList(),
30-
Map() => obj.map<String, dynamic>(
31-
(k, v) => MapEntry(k.toString(), _baselineEncodeRec(v))),
30+
Map() => obj.map<String, dynamic>((k, v) => MapEntry(k.toString(), _baselineEncodeRec(v))),
3231
_ => obj
3332
};
3433

3534
dynamic _baselineDecodeRec(dynamic obj) => switch (obj) {
3635
r"$null$" => null,
3736
Iterable() => obj.map((e) => _baselineDecodeRec(e)).toList(),
38-
Map() => obj
39-
.map<String, dynamic>((k, v) => MapEntry(k, _baselineDecodeRec(v))),
37+
Map() => obj.map<String, dynamic>((k, v) => MapEntry(k, _baselineDecodeRec(v))),
4038
_ => obj
4139
};
4240
}
4341

4442
extension DogTomlExtension on DogEngine {
45-
DogEngine get tomlEngine =>
46-
codec is TomlCodec ? this : getChildOrFork(#toml, codec: TomlCodec());
43+
DogEngine get tomlEngine => codec is TomlCodec ? this : getChildOrFork(#toml, codec: TomlCodec());
4744

4845
/// Converts a [value] to its YAML representation using the
4946
/// converter associated with [T], [type] or [tree].
50-
String toToml<T>(T value,
51-
{IterableKind kind = IterableKind.none, Type? type, TypeTree? tree}) {
52-
var native =
53-
tomlEngine.toNative<T>(value, kind: kind, type: type, tree: tree);
47+
String toToml<T>(T value, {IterableKind kind = IterableKind.none, Type? type, TypeTree? tree}) {
48+
var native = tomlEngine.toNative<T>(value, kind: kind, type: type, tree: tree);
5449
return TomlDocument.fromMap(native).toString();
5550
}
5651

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,4 @@
1-
# This file configures the static analysis results for your project (errors,
2-
# warnings, and lints).
3-
#
4-
# This enables the 'recommended' set of lints from `package:lints`.
5-
# This set helps identify many issues that may lead to problems when running
6-
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
7-
# style and format.
8-
#
9-
# If you want a smaller set of lints you can change this to specify
10-
# 'package:lints/core.yaml'. These are just the most critical lints
11-
# (the recommended set includes the core lints).
12-
# The core lints are also what is used by pub.dev for scoring packages.
13-
141
include: package:lints/recommended.yaml
152

16-
# Uncomment the following section to specify additional rules.
17-
18-
# linter:
19-
# rules:
20-
# - camel_case_types
21-
22-
# analyzer:
23-
# exclude:
24-
# - path/to/excluded/files/**
25-
26-
# For more information about the core and recommended set of lints, see
27-
# https://dart.dev/go/core-lints
28-
29-
# For additional information about configuring this file, see
30-
# https://dart.dev/guides/language/analysis-options
3+
formatter:
4+
page_width: 100

formats/dogs_yaml/lib/dogs_yaml.dart

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ class YamlCoercion implements CodecPrimitiveCoercion {
1414
return value.toDouble();
1515
}
1616

17-
throw ArgumentError.value(
18-
value, fieldName, "Can't coerce $value to expected $expected");
17+
throw ArgumentError.value(value, fieldName, "Can't coerce $value to expected $expected");
1918
}
2019
}
2120

@@ -47,30 +46,25 @@ class YamlCodec extends DefaultNativeCodec {
4746

4847
dynamic _baselineEncodeRec(dynamic obj) => switch (obj) {
4948
Iterable() => obj.map((e) => _baselineEncodeRec(e)).toList(),
50-
Map() => obj.map<String, dynamic>(
51-
(k, v) => MapEntry(k.toString(), _baselineEncodeRec(v))),
49+
Map() => obj.map<String, dynamic>((k, v) => MapEntry(k.toString(), _baselineEncodeRec(v))),
5250
_ => obj
5351
};
5452

5553
dynamic _baselineDecodeRec(dynamic obj) => switch (obj) {
5654
Iterable() => obj.map((e) => _baselineDecodeRec(e)).toList(),
57-
Map() => obj.map<String, dynamic>(
58-
(k, v) => MapEntry(k.toString(), _baselineDecodeRec(v))),
55+
Map() => obj.map<String, dynamic>((k, v) => MapEntry(k.toString(), _baselineDecodeRec(v))),
5956
_ => obj
6057
};
6158
}
6259

6360
extension DogYamlExtension on DogEngine {
64-
DogEngine get yamlEngine => codec is YamlCodec
65-
? this
66-
: getChildOrFork(#yaml, codec: const YamlCodec());
61+
DogEngine get yamlEngine =>
62+
codec is YamlCodec ? this : getChildOrFork(#yaml, codec: const YamlCodec());
6763

6864
/// Converts a [value] to its YAML representation using the
6965
/// converter associated with [T], [type] or [tree].
70-
String toYaml<T>(T value,
71-
{IterableKind kind = IterableKind.none, Type? type, TypeTree? tree}) {
72-
final native =
73-
yamlEngine.toNative<T>(value, kind: kind, type: type, tree: tree);
66+
String toYaml<T>(T value, {IterableKind kind = IterableKind.none, Type? type, TypeTree? tree}) {
67+
final native = yamlEngine.toNative<T>(value, kind: kind, type: type, tree: tree);
7468
return json2yaml(native, yamlStyle: YamlStyle.generic);
7569
}
7670

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,4 @@
1-
# This file configures the static analysis results for your project (errors,
2-
# warnings, and lints).
3-
#
4-
# This enables the 'recommended' set of lints from `package:lints`.
5-
# This set helps identify many issues that may lead to problems when running
6-
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
7-
# style and format.
8-
#
9-
# If you want a smaller set of lints you can change this to specify
10-
# 'package:lints/core.yaml'. These are just the most critical lints
11-
# (the recommended set includes the core lints).
12-
# The core lints are also what is used by pub.dev for scoring packages.
13-
141
include: package:lints/recommended.yaml
152

16-
# Uncomment the following section to specify additional rules.
17-
18-
# linter:
19-
# rules:
20-
# - camel_case_types
21-
22-
# analyzer:
23-
# exclude:
24-
# - path/to/excluded/files/**
25-
26-
# For more information about the core and recommended set of lints, see
27-
# https://dart.dev/go/core-lints
28-
29-
# For additional information about configuring this file, see
30-
# https://dart.dev/guides/language/analysis-options
3+
formatter:
4+
page_width: 100

packages/dogs_built/lib/collections.dart

Lines changed: 20 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -22,40 +22,33 @@ import 'package:built_collection/built_collection.dart';
2222
import 'package:dogs_core/dogs_core.dart';
2323

2424
class BuiltCollectionFactories {
25-
static final builtList =
26-
TreeBaseConverterFactory.createIterableFactory<BuiltList>(
25+
static final builtList = TreeBaseConverterFactory.createIterableFactory<BuiltList>(
2726
wrap: <T>(Iterable<T> entries) => BuiltList<T>.of(entries),
2827
unwrap: <T>(BuiltList value) => value,
2928
);
3029

31-
static final builtSet =
32-
TreeBaseConverterFactory.createIterableFactory<BuiltSet>(
30+
static final builtSet = TreeBaseConverterFactory.createIterableFactory<BuiltSet>(
3331
wrap: <T>(Iterable<T> entries) => BuiltSet<T>.of(entries),
3432
unwrap: <T>(BuiltSet value) => value,
3533
);
3634

3735
static final builtMap = TreeBaseConverterFactory.createNargsFactory<BuiltMap>(
3836
nargs: 2, consume: <K, V>() => BuiltMapNTreeArgConverter<K, V>());
3937

40-
static final builtListMultimap =
41-
TreeBaseConverterFactory.createNargsFactory<BuiltListMultimap>(
42-
nargs: 2,
43-
consume: <K, V>() => BuiltListMultimapNTreeArgConverter<K, V>());
38+
static final builtListMultimap = TreeBaseConverterFactory.createNargsFactory<BuiltListMultimap>(
39+
nargs: 2, consume: <K, V>() => BuiltListMultimapNTreeArgConverter<K, V>());
4440

45-
static final builtSetMultimap =
46-
TreeBaseConverterFactory.createNargsFactory<BuiltSetMultimap>(
47-
nargs: 2,
48-
consume: <K, V>() => BuiltSetMultimapNTreeArgConverter<K, V>());
41+
static final builtSetMultimap = TreeBaseConverterFactory.createNargsFactory<BuiltSetMultimap>(
42+
nargs: 2, consume: <K, V>() => BuiltSetMultimapNTreeArgConverter<K, V>());
4943
}
5044

5145
class BuiltMapNTreeArgConverter<K, V> extends NTreeArgConverter<BuiltMap> {
5246
@override
5347
BuiltMap deserialize(value, DogEngine engine) {
54-
return BuiltMap<K, V>(
55-
(value as Map).map<K, V>((key, value) => MapEntry<K, V>(
56-
deserializeArg(key, 0, engine),
57-
deserializeArg(value, 1, engine),
58-
)));
48+
return BuiltMap<K, V>((value as Map).map<K, V>((key, value) => MapEntry<K, V>(
49+
deserializeArg(key, 0, engine),
50+
deserializeArg(value, 1, engine),
51+
)));
5952
}
6053

6154
@override
@@ -67,42 +60,32 @@ class BuiltMapNTreeArgConverter<K, V> extends NTreeArgConverter<BuiltMap> {
6760
}
6861
}
6962

70-
class BuiltListMultimapNTreeArgConverter<K, V>
71-
extends NTreeArgConverter<BuiltListMultimap> {
63+
class BuiltListMultimapNTreeArgConverter<K, V> extends NTreeArgConverter<BuiltListMultimap> {
7264
@override
7365
BuiltListMultimap deserialize(value, DogEngine engine) {
74-
return BuiltListMultimap<K, V>((value as Map).map<K, Iterable<V>>(
75-
(key, value) => MapEntry<K, Iterable<V>>(
76-
deserializeArg(key, 0, engine),
77-
(value as Iterable)
78-
.map((p0) => deserializeArg(p0, 1, engine) as V)
79-
.toList())));
66+
return BuiltListMultimap<K, V>((value as Map).map<K, Iterable<V>>((key, value) =>
67+
MapEntry<K, Iterable<V>>(deserializeArg(key, 0, engine),
68+
(value as Iterable).map((p0) => deserializeArg(p0, 1, engine) as V).toList())));
8069
}
8170

8271
@override
8372
serialize(BuiltListMultimap value, DogEngine engine) {
8473
return value.toMap().map((key, value) => MapEntry(
85-
serializeArg(key, 0, engine),
86-
value.map((p0) => serializeArg(p0, 1, engine)).toList()));
74+
serializeArg(key, 0, engine), value.map((p0) => serializeArg(p0, 1, engine)).toList()));
8775
}
8876
}
8977

90-
class BuiltSetMultimapNTreeArgConverter<K, V>
91-
extends NTreeArgConverter<BuiltSetMultimap> {
78+
class BuiltSetMultimapNTreeArgConverter<K, V> extends NTreeArgConverter<BuiltSetMultimap> {
9279
@override
9380
BuiltSetMultimap deserialize(value, DogEngine engine) {
94-
return BuiltSetMultimap<K, V>((value as Map).map<K, Iterable<V>>(
95-
(key, value) => MapEntry<K, Iterable<V>>(
96-
deserializeArg(key, 0, engine),
97-
(value as Iterable)
98-
.map((p0) => deserializeArg(p0, 1, engine) as V)
99-
.toList())));
81+
return BuiltSetMultimap<K, V>((value as Map).map<K, Iterable<V>>((key, value) =>
82+
MapEntry<K, Iterable<V>>(deserializeArg(key, 0, engine),
83+
(value as Iterable).map((p0) => deserializeArg(p0, 1, engine) as V).toList())));
10084
}
10185

10286
@override
10387
serialize(BuiltSetMultimap value, DogEngine engine) {
10488
return value.toMap().map((key, value) => MapEntry(
105-
serializeArg(key, 0, engine),
106-
value.map((p0) => serializeArg(p0, 1, engine)).toList()));
89+
serializeArg(key, 0, engine), value.map((p0) => serializeArg(p0, 1, engine)).toList()));
10790
}
10891
}

packages/dogs_built/lib/dogs_built.dart

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ class DogBuiltRuntimeConverter extends DogConverter with OperationMapMixin {
4040
final Serializers mapper;
4141

4242
DogBuiltRuntimeConverter(this.serializer, this.mapper)
43-
: super(
44-
struct: DogStructure.synthetic(serializer.wireName),
45-
isAssociated: false);
43+
: super(struct: DogStructure.synthetic(serializer.wireName), isAssociated: false);
4644

4745
@override
4846
Map<Type, OperationMode Function()> get modes => {
@@ -78,19 +76,15 @@ DogPlugin BuiltInteropPlugin({
7876
"You should not register BuiltInteropPlugin multiple times.");
7977
}
8078

81-
serializers =
82-
(serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build();
79+
serializers = (serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build();
8380

81+
engine.registerTreeBaseFactory(TypeToken<BuiltList>(), BuiltCollectionFactories.builtList);
82+
engine.registerTreeBaseFactory(TypeToken<BuiltSet>(), BuiltCollectionFactories.builtSet);
83+
engine.registerTreeBaseFactory(TypeToken<BuiltMap>(), BuiltCollectionFactories.builtMap);
8484
engine.registerTreeBaseFactory(
85-
TypeToken<BuiltList>(), BuiltCollectionFactories.builtList);
85+
TypeToken<BuiltListMultimap>(), BuiltCollectionFactories.builtListMultimap);
8686
engine.registerTreeBaseFactory(
87-
TypeToken<BuiltSet>(), BuiltCollectionFactories.builtSet);
88-
engine.registerTreeBaseFactory(
89-
TypeToken<BuiltMap>(), BuiltCollectionFactories.builtMap);
90-
engine.registerTreeBaseFactory(TypeToken<BuiltListMultimap>(),
91-
BuiltCollectionFactories.builtListMultimap);
92-
engine.registerTreeBaseFactory(TypeToken<BuiltSetMultimap>(),
93-
BuiltCollectionFactories.builtSetMultimap);
87+
TypeToken<BuiltSetMultimap>(), BuiltCollectionFactories.builtSetMultimap);
9488

9589
engine.setMeta<BuiltInteropCompatibility>(BuiltInteropCompatibility(
9690
serializers: serializers,
@@ -101,8 +95,7 @@ DogPlugin BuiltInteropPlugin({
10195
for (var type in serializer.types) {
10296
if (engine.findStructureByType(type) == null) {
10397
// TODO: Maybe not all built_value serializers should be registered. May lead to problems with built_collection tree types.
104-
DogBuiltRuntimeConverter converter =
105-
DogBuiltRuntimeConverter(serializer, serializers);
98+
DogBuiltRuntimeConverter converter = DogBuiltRuntimeConverter(serializer, serializers);
10699
engine.registerAssociatedConverter(converter, type: type);
107100
engine.registerStructure(converter.struct!, type: type);
108101
engine.registerShelvedConverter(converter);

0 commit comments

Comments
 (0)