Skip to content

Commit

Permalink
refactor(mix_generator): fix lints (#395)
Browse files Browse the repository at this point in the history
* refactor: fix lints

* Update box_spec.dart

* Update pubspec.yaml

* Update test.yml

* Revert "Update test.yml"

This reverts commit a6b58a9.
  • Loading branch information
tilucasoli authored Jul 24, 2024
1 parent 3569a36 commit 2a9a7bb
Show file tree
Hide file tree
Showing 15 changed files with 120 additions and 82 deletions.
2 changes: 0 additions & 2 deletions packages/mix/lib/src/specs/box/box_spec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import 'package:flutter/widgets.dart';
import 'package:mix/mix.dart';
import 'package:mix_annotations/mix_annotations.dart';

import '../../internal/diagnostic_properties_builder_ext.dart';

part 'box_spec.g.dart';

const _constraints = MixableUtility(
Expand Down
36 changes: 23 additions & 13 deletions packages/mix/lib/src/specs/box/box_spec.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions packages/mix/lib/src/specs/flex/flex_spec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import 'package:flutter/widgets.dart';
import 'package:mix/mix.dart';
import 'package:mix_annotations/mix_annotations.dart';

import '../../internal/diagnostic_properties_builder_ext.dart';

part 'flex_spec.g.dart';

@MixableSpec()
Expand Down
32 changes: 21 additions & 11 deletions packages/mix/lib/src/specs/flex/flex_spec.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions packages/mix/lib/src/specs/icon/icon_spec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import 'package:flutter/widgets.dart';
import 'package:mix/mix.dart';
import 'package:mix_annotations/mix_annotations.dart';

import '../../internal/diagnostic_properties_builder_ext.dart';

part 'icon_spec.g.dart';

@MixableSpec()
Expand Down
27 changes: 16 additions & 11 deletions packages/mix/lib/src/specs/icon/icon_spec.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions packages/mix/lib/src/specs/image/image_spec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import 'package:flutter/widgets.dart';
import 'package:mix/mix.dart';
import 'package:mix_annotations/mix_annotations.dart';

import '../../internal/diagnostic_properties_builder_ext.dart';

part 'image_spec.g.dart';

@MixableSpec()
Expand Down
28 changes: 17 additions & 11 deletions packages/mix/lib/src/specs/image/image_spec.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions packages/mix/lib/src/specs/stack/stack_spec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import 'package:flutter/widgets.dart';
import 'package:mix/mix.dart';
import 'package:mix_annotations/mix_annotations.dart';

import '../../internal/diagnostic_properties_builder_ext.dart';

part 'stack_spec.g.dart';

@MixableSpec()
Expand Down
17 changes: 11 additions & 6 deletions packages/mix/lib/src/specs/stack/stack_spec.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions packages/mix/lib/src/specs/text/text_spec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import 'package:flutter/widgets.dart';
import 'package:mix/mix.dart';
import 'package:mix_annotations/mix_annotations.dart';

import '../../internal/diagnostic_properties_builder_ext.dart';

part 'text_spec.g.dart';

@MixableSpec()
Expand Down
42 changes: 28 additions & 14 deletions packages/mix/lib/src/specs/text/text_spec.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/mix/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
sdk: flutter

dev_dependencies:
flutter_lints: ^3.0.1
flutter_lints: ^4.0.0
flutter_test:
sdk: flutter
dart_code_metrics_presets: ^2.13.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ String methodDebugFillProperties({
final fieldStatements = fields.map((field) {
final fieldName = isInternalRef ? field.asInternalRef : field.name;
if (_expandableFields.contains(fieldName)) {
return 'properties.add(DiagnosticsProperty(\'$fieldName\', $fieldName, expandableValue: true));';
return 'properties.add(DiagnosticsProperty(\'$fieldName\', $fieldName, expandableValue: true, defaultValue: null));';
}
return 'properties.add(DiagnosticsProperty(\'$fieldName\', $fieldName));';
return 'properties.add(DiagnosticsProperty(\'$fieldName\', $fieldName, defaultValue: null));';
}).join('\n');

return '''
Expand Down
2 changes: 1 addition & 1 deletion packages/mix_generator/lib/src/builders/method_merge.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ String mergeMethodBuilder({

return '$propAssignment $thisName$nullable.merge(other.$propName) ?? other.$propName';
} else {
return '$propAssignment other$nullable.$propName ?? $thisName';
return '$propAssignment other.$propName ?? $thisName';
}
}).join(',\n ');

Expand Down

0 comments on commit 2a9a7bb

Please sign in to comment.