Browse Source

Merge pull request #1025 from nextcloud/feat/dynamite/config

feat(dynamite): introduce dynamite config to set ignore directives
pull/1033/head
Nikolas Rimikis 1 year ago committed by GitHub
parent
commit
35de0d689b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 29
      packages/dynamite/dynamite/README.md
  2. 2
      packages/dynamite/dynamite/lib/builder.dart
  3. 58
      packages/dynamite/dynamite/lib/src/builder/imports.dart
  4. 5
      packages/dynamite/dynamite/lib/src/builder/state.dart
  5. 1
      packages/dynamite/dynamite/lib/src/models/config.dart
  6. 38
      packages/dynamite/dynamite/lib/src/models/dynamite_config/config.dart
  7. 170
      packages/dynamite/dynamite/lib/src/models/dynamite_config/config.g.dart
  8. 42
      packages/dynamite/dynamite/lib/src/openapi_builder.dart
  9. 12
      packages/dynamite/dynamite_end_to_end_test/build.yaml
  10. 18
      packages/dynamite/dynamite_end_to_end_test/lib/headers.openapi.dart
  11. 66
      packages/dynamite/dynamite_end_to_end_test/lib/nested_ofs.openapi.dart
  12. 12
      packages/nextcloud/build.yaml

29
packages/dynamite/dynamite/README.md

@ -0,0 +1,29 @@
Provides a [Dart Build System](https://github.com/dart-lang/build) builder for generating clients from an [OpenAPI specifications](https://swagger.io/specification/).
The builder generates code if it find files with an `.openapi.json` or `.openapi.yaml` extension in the lib directory.
# Build configuration
You can configure code generation by setting values in the `build.yaml`.
```yaml
targets:
$default:
builders:
dynamite:
options:
# Options configure how source code is generated.
#
# The following are sensible default values that ignores the schemas for the coverage.
analyzer_ignores:
- camel_case_types
- discarded_futures
- public_member_api_docs
- unreachable_switch_case
coverage_ignores:
- 'const .*\._\(\);'
- 'factory .*\.fromJson\(Map<String, dynamic> json\) => _jsonSerializers\.deserializeWith\(serializer, json\)!;'
- 'Map<String, dynamic> toJson\(\) => _jsonSerializers\.serializeWith\(serializer, this\)! as Map<String, dynamic>;'
- 'static BuiltSet<.*> get values => _\$.*Values;'
```

2
packages/dynamite/dynamite/lib/builder.dart

@ -1,4 +1,4 @@
import 'package:build/build.dart';
import 'package:dynamite/dynamite.dart';
Builder openAPIBuilder(final BuilderOptions options) => OpenAPIBuilder();
Builder openAPIBuilder(final BuilderOptions options) => OpenAPIBuilder(options);

58
packages/dynamite/dynamite/lib/src/builder/imports.dart

@ -3,29 +3,35 @@ import 'package:code_builder/code_builder.dart';
import 'package:dynamite/src/builder/state.dart';
import 'package:path/path.dart' as p;
List<Spec> generateImports(final AssetId outputId, final State state) => [
const Code('// ignore_for_file: camel_case_types'),
const Code('// ignore_for_file: discarded_futures'),
const Code('// ignore_for_file: public_member_api_docs'),
const Code('// ignore_for_file: unreachable_switch_case'),
Directive.import('dart:convert'),
Directive.import('dart:typed_data'),
const Code(''),
Directive.import('package:built_collection/built_collection.dart'),
Directive.import('package:built_value/built_value.dart'),
Directive.import('package:built_value/json_object.dart'),
Directive.import('package:built_value/serializer.dart'),
Directive.import('package:built_value/standard_json_plugin.dart'),
Directive.import('package:collection/collection.dart'),
Directive.import('package:dynamite_runtime/built_value.dart'),
Directive.import('package:dynamite_runtime/http_client.dart'),
Directive.import('package:dynamite_runtime/models.dart'),
Directive.import('package:dynamite_runtime/utils.dart'),
Directive.import('package:meta/meta.dart'),
Directive.import('package:universal_io/io.dart'),
const Code(''),
if (state.hasResolvedBuiltTypes) ...[
Directive.part(p.basename(outputId.changeExtension('.g.dart').path)),
const Code(''),
],
];
Iterable<Spec> generateImports(final AssetId outputId, final State state) sync* {
final analyzerIgnores = state.buildConfig.analyzerIgnores;
if (analyzerIgnores != null) {
for (final rule in analyzerIgnores) {
yield Code('// ignore_for_file: $rule');
}
}
yield* [
Directive.import('dart:convert'),
Directive.import('dart:typed_data'),
const Code(''),
Directive.import('package:built_collection/built_collection.dart'),
Directive.import('package:built_value/built_value.dart'),
Directive.import('package:built_value/json_object.dart'),
Directive.import('package:built_value/serializer.dart'),
Directive.import('package:built_value/standard_json_plugin.dart'),
Directive.import('package:collection/collection.dart'),
Directive.import('package:dynamite_runtime/built_value.dart'),
Directive.import('package:dynamite_runtime/http_client.dart'),
Directive.import('package:dynamite_runtime/models.dart'),
Directive.import('package:dynamite_runtime/utils.dart'),
Directive.import('package:meta/meta.dart'),
Directive.import('package:universal_io/io.dart'),
const Code(''),
];
if (state.hasResolvedBuiltTypes) {
yield Directive.part(p.basename(outputId.changeExtension('.g.dart').path));
yield const Code('');
}
}

5
packages/dynamite/dynamite/lib/src/builder/state.dart

@ -1,8 +1,11 @@
import 'package:code_builder/code_builder.dart';
import 'package:dynamite/src/models/dynamite_config/config.dart';
import 'package:dynamite/src/models/type_result.dart';
class State {
State();
State(this.buildConfig);
final DynamiteConfig buildConfig;
final output = <Spec>[];
final resolvedTypes = <TypeResult>{};

1
packages/dynamite/dynamite/lib/src/models/config.dart

@ -0,0 +1 @@
export 'dynamite_config/config.dart';

38
packages/dynamite/dynamite/lib/src/models/dynamite_config/config.dart

@ -0,0 +1,38 @@
import 'package:built_collection/built_collection.dart';
import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';
import 'package:built_value/standard_json_plugin.dart';
part 'config.g.dart';
/// The configuration used by the dynamite builder.
abstract class DynamiteConfig implements Built<DynamiteConfig, DynamiteConfigBuilder> {
factory DynamiteConfig([final void Function(DynamiteConfigBuilder) updates]) = _$DynamiteConfig;
const DynamiteConfig._();
/// Constructs the dynamite config from a json like map.
factory DynamiteConfig.fromJson(final Map<String, dynamic> json) => _serializers.deserializeWith(serializer, json)!;
/// Serializes this configuration to json.
Map<String, dynamic> toJson() => _serializers.serializeWith(serializer, this)! as Map<String, dynamic>;
static Serializer<DynamiteConfig> get serializer => _$dynamiteConfigSerializer;
static const String configPath = 'dynamite.yaml';
/// A set of lint rules to ignore for the entire generated file.
@BuiltValueField(wireName: 'analyzer_ignores')
BuiltSet<String>? get analyzerIgnores;
/// A set of regular expressions used to exclude parts from code coverage.
///
/// All matches will be wrapped in `// coverage:ignore-start` and `// coverage:ignore-end` blocks.
@BuiltValueField(wireName: 'coverage_ignores')
BuiltSet<String>? get coverageIgnores;
}
@SerializersFor([
DynamiteConfig,
])
final Serializers _serializers = (_$_serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build();

170
packages/dynamite/dynamite/lib/src/models/dynamite_config/config.g.dart

@ -0,0 +1,170 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'config.dart';
// **************************************************************************
// BuiltValueGenerator
// **************************************************************************
Serializers _$_serializers = (Serializers().toBuilder()
..add(DynamiteConfig.serializer)
..addBuilderFactory(const FullType(BuiltSet, [FullType(String)]), () => SetBuilder<String>())
..addBuilderFactory(const FullType(BuiltSet, [FullType(String)]), () => SetBuilder<String>()))
.build();
Serializer<DynamiteConfig> _$dynamiteConfigSerializer = _$DynamiteConfigSerializer();
class _$DynamiteConfigSerializer implements StructuredSerializer<DynamiteConfig> {
@override
final Iterable<Type> types = const [DynamiteConfig, _$DynamiteConfig];
@override
final String wireName = 'DynamiteConfig';
@override
Iterable<Object?> serialize(Serializers serializers, DynamiteConfig object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
Object? value;
value = object.analyzerIgnores;
if (value != null) {
result
..add('analyzer_ignores')
..add(serializers.serialize(value, specifiedType: const FullType(BuiltSet, [FullType(String)])));
}
value = object.coverageIgnores;
if (value != null) {
result
..add('coverage_ignores')
..add(serializers.serialize(value, specifiedType: const FullType(BuiltSet, [FullType(String)])));
}
return result;
}
@override
DynamiteConfig deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = DynamiteConfigBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current! as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case 'analyzer_ignores':
result.analyzerIgnores.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltSet, [FullType(String)]))! as BuiltSet<Object?>);
break;
case 'coverage_ignores':
result.coverageIgnores.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltSet, [FullType(String)]))! as BuiltSet<Object?>);
break;
}
}
return result.build();
}
}
class _$DynamiteConfig extends DynamiteConfig {
@override
final BuiltSet<String>? analyzerIgnores;
@override
final BuiltSet<String>? coverageIgnores;
factory _$DynamiteConfig([void Function(DynamiteConfigBuilder)? updates]) =>
(DynamiteConfigBuilder()..update(updates))._build();
_$DynamiteConfig._({this.analyzerIgnores, this.coverageIgnores}) : super._();
@override
DynamiteConfig rebuild(void Function(DynamiteConfigBuilder) updates) => (toBuilder()..update(updates)).build();
@override
DynamiteConfigBuilder toBuilder() => DynamiteConfigBuilder()..replace(this);
@override
bool operator ==(Object other) {
if (identical(other, this)) return true;
return other is DynamiteConfig &&
analyzerIgnores == other.analyzerIgnores &&
coverageIgnores == other.coverageIgnores;
}
@override
int get hashCode {
var _$hash = 0;
_$hash = $jc(_$hash, analyzerIgnores.hashCode);
_$hash = $jc(_$hash, coverageIgnores.hashCode);
_$hash = $jf(_$hash);
return _$hash;
}
@override
String toString() {
return (newBuiltValueToStringHelper(r'DynamiteConfig')
..add('analyzerIgnores', analyzerIgnores)
..add('coverageIgnores', coverageIgnores))
.toString();
}
}
class DynamiteConfigBuilder implements Builder<DynamiteConfig, DynamiteConfigBuilder> {
_$DynamiteConfig? _$v;
SetBuilder<String>? _analyzerIgnores;
SetBuilder<String> get analyzerIgnores => _$this._analyzerIgnores ??= SetBuilder<String>();
set analyzerIgnores(SetBuilder<String>? analyzerIgnores) => _$this._analyzerIgnores = analyzerIgnores;
SetBuilder<String>? _coverageIgnores;
SetBuilder<String> get coverageIgnores => _$this._coverageIgnores ??= SetBuilder<String>();
set coverageIgnores(SetBuilder<String>? coverageIgnores) => _$this._coverageIgnores = coverageIgnores;
DynamiteConfigBuilder();
DynamiteConfigBuilder get _$this {
final $v = _$v;
if ($v != null) {
_analyzerIgnores = $v.analyzerIgnores?.toBuilder();
_coverageIgnores = $v.coverageIgnores?.toBuilder();
_$v = null;
}
return this;
}
@override
void replace(DynamiteConfig other) {
ArgumentError.checkNotNull(other, 'other');
_$v = other as _$DynamiteConfig;
}
@override
void update(void Function(DynamiteConfigBuilder)? updates) {
if (updates != null) updates(this);
}
@override
DynamiteConfig build() => _build();
_$DynamiteConfig _build() {
_$DynamiteConfig _$result;
try {
_$result = _$v ??
_$DynamiteConfig._(analyzerIgnores: _analyzerIgnores?.build(), coverageIgnores: _coverageIgnores?.build());
} catch (_) {
late String _$failedField;
try {
_$failedField = 'analyzerIgnores';
_analyzerIgnores?.build();
_$failedField = 'coverageIgnores';
_coverageIgnores?.build();
} catch (e) {
throw BuiltValueNestedFieldError(r'DynamiteConfig', _$failedField, e.toString());
}
rethrow;
}
replace(_$result);
return _$result;
}
}
// ignore_for_file: deprecated_member_use_from_same_package,type=lint

42
packages/dynamite/dynamite/lib/src/openapi_builder.dart

@ -10,10 +10,15 @@ import 'package:dynamite/src/builder/generate_schemas.dart';
import 'package:dynamite/src/builder/imports.dart';
import 'package:dynamite/src/builder/serializer.dart';
import 'package:dynamite/src/builder/state.dart';
import 'package:dynamite/src/models/config.dart';
import 'package:dynamite/src/models/openapi.dart' as openapi;
import 'package:version/version.dart';
class OpenAPIBuilder implements Builder {
OpenAPIBuilder(
final BuilderOptions options,
) : buildConfig = DynamiteConfig.fromJson(options.config);
@override
final buildExtensions = const {
'.openapi.json': ['.openapi.dart'],
@ -26,6 +31,9 @@ class OpenAPIBuilder implements Builder {
/// The maximum openapi version supported by this builder.
static final Version maxSupportedVersion = minSupportedVersion.incrementMajor();
/// The configuration for this builder.
final DynamiteConfig buildConfig;
@override
Future<void> build(final BuildStep buildStep) async {
try {
@ -54,7 +62,7 @@ class OpenAPIBuilder implements Builder {
throw Exception('Only OpenAPI between $minSupportedVersion and $maxSupportedVersion are supported.');
}
final state = State();
final state = State(buildConfig);
// Imports need to be generated after everything else so we know if we need the local part directive,
// but they need to be added to the beginning of the output.
@ -64,28 +72,20 @@ class OpenAPIBuilder implements Builder {
..addAll(buildSerializer(state))
..insertAll(0, generateImports(outputId, state));
final patterns = [
RegExp(
r'const .*\._\(\);',
),
RegExp(
r'factory .*\.fromJson\(Map<String, dynamic> json\) => _jsonSerializers\.deserializeWith\(serializer, json\)!;',
),
RegExp(
r'Map<String, dynamic> toJson\(\) => _jsonSerializers\.serializeWith\(serializer, this\)! as Map<String, dynamic>;',
),
RegExp(
r'static BuiltSet<.*> get values => _\$.*Values;',
),
];
var outputString = output.build().map((final e) => e.accept(emitter)).join('\n');
for (final pattern in patterns) {
outputString = outputString.replaceAllMapped(
pattern,
(final match) => ' // coverage:ignore-start\n${match.group(0)}\n // coverage:ignore-end',
);
final coverageIgnores = state.buildConfig.coverageIgnores;
if (coverageIgnores != null) {
for (final ignore in coverageIgnores) {
final pattern = RegExp(ignore);
outputString = outputString.replaceAllMapped(
pattern,
(final match) => ' // coverage:ignore-start\n${match.group(0)}\n // coverage:ignore-end',
);
}
}
final formatter = DartFormatter(pageWidth: 120);
await buildStep.writeAsString(
outputId,

12
packages/dynamite/dynamite_end_to_end_test/build.yaml

@ -0,0 +1,12 @@
targets:
$default:
builders:
built_value_generator|built_value:
enabled: true
dynamite:
options:
analyzer_ignores:
- camel_case_types
- discarded_futures
- public_member_api_docs
- unreachable_switch_case

18
packages/dynamite/dynamite_end_to_end_test/lib/headers.openapi.dart

@ -185,17 +185,11 @@ abstract interface class GetHeadersInterface {
abstract class GetHeaders implements GetHeadersInterface, Built<GetHeaders, GetHeadersBuilder> {
factory GetHeaders([final void Function(GetHeadersBuilder)? b]) = _$GetHeaders;
// coverage:ignore-start
const GetHeaders._();
// coverage:ignore-end
// coverage:ignore-start
factory GetHeaders.fromJson(final Map<String, dynamic> json) => _jsonSerializers.deserializeWith(serializer, json)!;
// coverage:ignore-end
// coverage:ignore-start
Map<String, dynamic> toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;
// coverage:ignore-end
@BuiltValueSerializer(custom: true)
static Serializer<GetHeaders> get serializer => _$GetHeadersSerializer();
@ -253,18 +247,12 @@ abstract class WithContentOperationIdHeaders
factory WithContentOperationIdHeaders([final void Function(WithContentOperationIdHeadersBuilder)? b]) =
_$WithContentOperationIdHeaders;
// coverage:ignore-start
const WithContentOperationIdHeaders._();
// coverage:ignore-end
// coverage:ignore-start
factory WithContentOperationIdHeaders.fromJson(final Map<String, dynamic> json) =>
_jsonSerializers.deserializeWith(serializer, json)!;
// coverage:ignore-end
// coverage:ignore-start
Map<String, dynamic> toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;
// coverage:ignore-end
@BuiltValueSerializer(custom: true)
static Serializer<WithContentOperationIdHeaders> get serializer => _$WithContentOperationIdHeadersSerializer();
@ -319,18 +307,12 @@ abstract class GetWithContentHeaders
implements GetWithContentHeadersInterface, Built<GetWithContentHeaders, GetWithContentHeadersBuilder> {
factory GetWithContentHeaders([final void Function(GetWithContentHeadersBuilder)? b]) = _$GetWithContentHeaders;
// coverage:ignore-start
const GetWithContentHeaders._();
// coverage:ignore-end
// coverage:ignore-start
factory GetWithContentHeaders.fromJson(final Map<String, dynamic> json) =>
_jsonSerializers.deserializeWith(serializer, json)!;
// coverage:ignore-end
// coverage:ignore-start
Map<String, dynamic> toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;
// coverage:ignore-end
@BuiltValueSerializer(custom: true)
static Serializer<GetWithContentHeaders> get serializer => _$GetWithContentHeadersSerializer();

66
packages/dynamite/dynamite_end_to_end_test/lib/nested_ofs.openapi.dart

@ -39,17 +39,11 @@ abstract interface class BaseInterface {
abstract class Base implements BaseInterface, Built<Base, BaseBuilder> {
factory Base([final void Function(BaseBuilder)? b]) = _$Base;
// coverage:ignore-start
const Base._();
// coverage:ignore-end
// coverage:ignore-start
factory Base.fromJson(final Map<String, dynamic> json) => _jsonSerializers.deserializeWith(serializer, json)!;
// coverage:ignore-end
// coverage:ignore-start
Map<String, dynamic> toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;
// coverage:ignore-end
static Serializer<Base> get serializer => _$baseSerializer;
}
@ -66,17 +60,11 @@ abstract interface class BaseAllOfInterface implements BaseInterface, BaseAllOf_
abstract class BaseAllOf implements BaseAllOfInterface, Built<BaseAllOf, BaseAllOfBuilder> {
factory BaseAllOf([final void Function(BaseAllOfBuilder)? b]) = _$BaseAllOf;
// coverage:ignore-start
const BaseAllOf._();
// coverage:ignore-end
// coverage:ignore-start
factory BaseAllOf.fromJson(final Map<String, dynamic> json) => _jsonSerializers.deserializeWith(serializer, json)!;
// coverage:ignore-end
// coverage:ignore-start
Map<String, dynamic> toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;
// coverage:ignore-end
static Serializer<BaseAllOf> get serializer => _$baseAllOfSerializer;
}
@ -90,17 +78,11 @@ abstract interface class BaseOneOf1Interface {
abstract class BaseOneOf1 implements BaseOneOf1Interface, Built<BaseOneOf1, BaseOneOf1Builder> {
factory BaseOneOf1([final void Function(BaseOneOf1Builder)? b]) = _$BaseOneOf1;
// coverage:ignore-start
const BaseOneOf1._();
// coverage:ignore-end
// coverage:ignore-start
factory BaseOneOf1.fromJson(final Map<String, dynamic> json) => _jsonSerializers.deserializeWith(serializer, json)!;
// coverage:ignore-end
// coverage:ignore-start
Map<String, dynamic> toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;
// coverage:ignore-end
static Serializer<BaseOneOf1> get serializer => _$baseOneOf1Serializer;
}
@ -114,17 +96,11 @@ abstract interface class BaseOneOfInterface {
abstract class BaseOneOf implements BaseOneOfInterface, Built<BaseOneOf, BaseOneOfBuilder> {
factory BaseOneOf([final void Function(BaseOneOfBuilder)? b]) = _$BaseOneOf;
// coverage:ignore-start
const BaseOneOf._();
// coverage:ignore-end
// coverage:ignore-start
factory BaseOneOf.fromJson(final Map<String, dynamic> json) => _jsonSerializers.deserializeWith(serializer, json)!;
// coverage:ignore-end
// coverage:ignore-start
Map<String, dynamic> toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;
// coverage:ignore-end
@BuiltValueSerializer(custom: true)
static Serializer<BaseOneOf> get serializer => _$BaseOneOfSerializer();
@ -178,17 +154,11 @@ abstract interface class BaseAnyOf1Interface {
abstract class BaseAnyOf1 implements BaseAnyOf1Interface, Built<BaseAnyOf1, BaseAnyOf1Builder> {
factory BaseAnyOf1([final void Function(BaseAnyOf1Builder)? b]) = _$BaseAnyOf1;
// coverage:ignore-start
const BaseAnyOf1._();
// coverage:ignore-end
// coverage:ignore-start
factory BaseAnyOf1.fromJson(final Map<String, dynamic> json) => _jsonSerializers.deserializeWith(serializer, json)!;
// coverage:ignore-end
// coverage:ignore-start
Map<String, dynamic> toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;
// coverage:ignore-end
static Serializer<BaseAnyOf1> get serializer => _$baseAnyOf1Serializer;
}
@ -202,17 +172,11 @@ abstract interface class BaseAnyOfInterface {
abstract class BaseAnyOf implements BaseAnyOfInterface, Built<BaseAnyOf, BaseAnyOfBuilder> {
factory BaseAnyOf([final void Function(BaseAnyOfBuilder)? b]) = _$BaseAnyOf;
// coverage:ignore-start
const BaseAnyOf._();
// coverage:ignore-end
// coverage:ignore-start
factory BaseAnyOf.fromJson(final Map<String, dynamic> json) => _jsonSerializers.deserializeWith(serializer, json)!;
// coverage:ignore-end
// coverage:ignore-start
Map<String, dynamic> toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;
// coverage:ignore-end
@BuiltValueSerializer(custom: true)
static Serializer<BaseAnyOf> get serializer => _$BaseAnyOfSerializer();
@ -270,18 +234,12 @@ abstract interface class BaseNestedAllOfInterface
abstract class BaseNestedAllOf implements BaseNestedAllOfInterface, Built<BaseNestedAllOf, BaseNestedAllOfBuilder> {
factory BaseNestedAllOf([final void Function(BaseNestedAllOfBuilder)? b]) = _$BaseNestedAllOf;
// coverage:ignore-start
const BaseNestedAllOf._();
// coverage:ignore-end
// coverage:ignore-start
factory BaseNestedAllOf.fromJson(final Map<String, dynamic> json) =>
_jsonSerializers.deserializeWith(serializer, json)!;
// coverage:ignore-end
// coverage:ignore-start
Map<String, dynamic> toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;
// coverage:ignore-end
static Serializer<BaseNestedAllOf> get serializer => _$baseNestedAllOfSerializer;
}
@ -295,18 +253,12 @@ abstract interface class BaseNestedOneOf3Interface {
abstract class BaseNestedOneOf3 implements BaseNestedOneOf3Interface, Built<BaseNestedOneOf3, BaseNestedOneOf3Builder> {
factory BaseNestedOneOf3([final void Function(BaseNestedOneOf3Builder)? b]) = _$BaseNestedOneOf3;
// coverage:ignore-start
const BaseNestedOneOf3._();
// coverage:ignore-end
// coverage:ignore-start
factory BaseNestedOneOf3.fromJson(final Map<String, dynamic> json) =>
_jsonSerializers.deserializeWith(serializer, json)!;
// coverage:ignore-end
// coverage:ignore-start
Map<String, dynamic> toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;
// coverage:ignore-end
static Serializer<BaseNestedOneOf3> get serializer => _$baseNestedOneOf3Serializer;
}
@ -322,18 +274,12 @@ abstract interface class BaseNestedOneOfInterface {
abstract class BaseNestedOneOf implements BaseNestedOneOfInterface, Built<BaseNestedOneOf, BaseNestedOneOfBuilder> {
factory BaseNestedOneOf([final void Function(BaseNestedOneOfBuilder)? b]) = _$BaseNestedOneOf;
// coverage:ignore-start
const BaseNestedOneOf._();
// coverage:ignore-end
// coverage:ignore-start
factory BaseNestedOneOf.fromJson(final Map<String, dynamic> json) =>
_jsonSerializers.deserializeWith(serializer, json)!;
// coverage:ignore-end
// coverage:ignore-start
Map<String, dynamic> toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;
// coverage:ignore-end
@BuiltValueSerializer(custom: true)
static Serializer<BaseNestedOneOf> get serializer => _$BaseNestedOneOfSerializer();
@ -399,18 +345,12 @@ abstract interface class BaseNestedAnyOf3Interface {
abstract class BaseNestedAnyOf3 implements BaseNestedAnyOf3Interface, Built<BaseNestedAnyOf3, BaseNestedAnyOf3Builder> {
factory BaseNestedAnyOf3([final void Function(BaseNestedAnyOf3Builder)? b]) = _$BaseNestedAnyOf3;
// coverage:ignore-start
const BaseNestedAnyOf3._();
// coverage:ignore-end
// coverage:ignore-start
factory BaseNestedAnyOf3.fromJson(final Map<String, dynamic> json) =>
_jsonSerializers.deserializeWith(serializer, json)!;
// coverage:ignore-end
// coverage:ignore-start
Map<String, dynamic> toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;
// coverage:ignore-end
static Serializer<BaseNestedAnyOf3> get serializer => _$baseNestedAnyOf3Serializer;
}
@ -426,18 +366,12 @@ abstract interface class BaseNestedAnyOfInterface {
abstract class BaseNestedAnyOf implements BaseNestedAnyOfInterface, Built<BaseNestedAnyOf, BaseNestedAnyOfBuilder> {
factory BaseNestedAnyOf([final void Function(BaseNestedAnyOfBuilder)? b]) = _$BaseNestedAnyOf;
// coverage:ignore-start
const BaseNestedAnyOf._();
// coverage:ignore-end
// coverage:ignore-start
factory BaseNestedAnyOf.fromJson(final Map<String, dynamic> json) =>
_jsonSerializers.deserializeWith(serializer, json)!;
// coverage:ignore-end
// coverage:ignore-start
Map<String, dynamic> toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;
// coverage:ignore-end
@BuiltValueSerializer(custom: true)
static Serializer<BaseNestedAnyOf> get serializer => _$BaseNestedAnyOfSerializer();

12
packages/nextcloud/build.yaml

@ -3,3 +3,15 @@ targets:
builders:
built_value_generator|built_value:
enabled: true
dynamite:
options:
analyzer_ignores:
- camel_case_types
- discarded_futures
- public_member_api_docs
- unreachable_switch_case
coverage_ignores:
- 'const .*\._\(\);'
- 'factory .*\.fromJson\(Map<String, dynamic> json\) => _jsonSerializers\.deserializeWith\(serializer, json\)!;'
- 'Map<String, dynamic> toJson\(\) => _jsonSerializers\.serializeWith\(serializer, this\)! as Map<String, dynamic>;'
- 'static BuiltSet<.*> get values => _\$.*Values;'

Loading…
Cancel
Save