diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 01ea925c..b0012471 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -47,6 +47,15 @@ jobs: - name: Analyze root project run: flutter analyze + - name: Install DCM + uses: CQLabs/setup-dcm@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Run DCM + run: dcm analyze . + shell: bash + - name: Run root tests run: flutter test --coverage diff --git a/analysis_options.yaml b/analysis_options.yaml index dd583f37..e8a18fe9 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,4 +1,61 @@ -# include: ../../lints_with_dcm.yaml +dart_code_metrics: + extends: + - package:dart_code_metrics_presets/recommended.yaml + - package:dart_code_metrics_presets/metrics_recommended.yaml + metrics-exclude: + - test/** + rules-exclude: + - test/** + rules: + # avoid-collection-mutating-methods: true + newline-before-return: true + avoid-importing-entrypoint-exports: + only-in-src: true + prefer-match-file-name: false + avoid-suspicious-super-overrides: false + prefer-overriding-parent-equality: false + prefer-correct-callback-field-name: false + prefer-single-widget-per-file: false + match-getter-setter-field-names: false + prefer-dedicated-media-query-methods: false + avoid-shadowing: false + enum-constants-ordering: false + avoid-unsafe-collection-methods: false + prefer-prefixed-global-constants: false + avoid-returning-widgets: false + avoid-unnecessary-overrides: false + arguments-ordering: + first: + - key + - spec + last: + - child + - children + avoid-nested-conditional-expressions: + acceptable-level: 3 + member-ordering: + order: + - public-fields + - private-fields + - constructors + - static-methods + - private-methods + - private-getters + - private-setters + - public-getters + - public-setters + - public-methods + - overridden-public-methods + - overridden-public-getters + - build-method + prefer-named-boolean-parameters: + ignore-single: true analyzer: errors: non_constant_identifier_names: ignore + +linter: + rules: + # TODO: Turn this to true when all public apis are documented + public_member_api_docs: false + prefer_relative_imports: true \ No newline at end of file diff --git a/lib/src/components/content_presentation/accordion/accordion.dart b/lib/src/components/content_presentation/accordion/accordion.dart index f7427a4d..11611523 100644 --- a/lib/src/components/content_presentation/accordion/accordion.dart +++ b/lib/src/components/content_presentation/accordion/accordion.dart @@ -76,7 +76,6 @@ base class AccordionSpec extends Spec with _$AccordionSpec { contentContainer: _$this.contentContainer.lerp(other.contentContainer, t), headerContainer: _$this.headerContainer.lerp(other.headerContainer, t), leadingIcon: IconThemeData.lerp(_$this.leadingIcon, other.leadingIcon, t), - // trailingIcon: IconData.lerp(_$this.trailingIcon, other.trailingIcon, t), titleStyle: MixHelpers.lerpTextStyle(_$this.titleStyle, other.titleStyle, t)!, contentStyle: diff --git a/lib/src/components/content_presentation/chip/chip.dart b/lib/src/components/content_presentation/chip/chip.dart index 5b2b56ee..15201492 100644 --- a/lib/src/components/content_presentation/chip/chip.dart +++ b/lib/src/components/content_presentation/chip/chip.dart @@ -3,10 +3,10 @@ import 'package:flutter/widgets.dart'; import 'package:mix/mix.dart'; import 'package:mix_annotations/mix_annotations.dart'; import 'package:naked_ui/naked_ui.dart'; -import 'package:remix/src/helpers/style_mix_ext.dart'; import '../../../helpers/mix_controller_mixin.dart'; import '../../../helpers/remix_builder.dart'; +import '../../../helpers/style_mix_ext.dart'; part 'chip.g.dart'; part 'chip_style.dart'; diff --git a/lib/src/components/form/checkbox/checkbox.dart b/lib/src/components/form/checkbox/checkbox.dart index b85d4fdb..57ebfab8 100644 --- a/lib/src/components/form/checkbox/checkbox.dart +++ b/lib/src/components/form/checkbox/checkbox.dart @@ -3,10 +3,10 @@ import 'package:flutter/material.dart'; import 'package:mix/mix.dart'; import 'package:mix_annotations/mix_annotations.dart'; import 'package:naked_ui/naked_ui.dart'; -import 'package:remix/src/helpers/style_mix_ext.dart'; import '../../../helpers/mix_controller_mixin.dart'; import '../../../helpers/remix_builder.dart'; +import '../../../helpers/style_mix_ext.dart'; part 'checkbox.g.dart'; part 'checkbox_style.dart'; diff --git a/lib/src/components/form/radio/radio.dart b/lib/src/components/form/radio/radio.dart index 0d3acdae..b5d37330 100644 --- a/lib/src/components/form/radio/radio.dart +++ b/lib/src/components/form/radio/radio.dart @@ -3,8 +3,8 @@ import 'package:flutter/widgets.dart'; import 'package:mix/mix.dart'; import 'package:mix_annotations/mix_annotations.dart'; import 'package:naked_ui/naked_ui.dart'; -import 'package:remix/src/helpers/style_mix_ext.dart'; +import '../../../helpers/style_mix_ext.dart'; import '../../../core/style_scope.dart'; import '../../../helpers/mix_controller_mixin.dart'; import '../../../helpers/remix_builder.dart'; diff --git a/lib/src/components/form/select/select.dart b/lib/src/components/form/select/select.dart index 6366e977..d4769aaa 100644 --- a/lib/src/components/form/select/select.dart +++ b/lib/src/components/form/select/select.dart @@ -6,8 +6,8 @@ import 'package:mix/experimental.dart'; import 'package:mix/mix.dart'; import 'package:mix_annotations/mix_annotations.dart'; import 'package:naked_ui/naked_ui.dart'; -import 'package:remix/src/helpers/style_mix_ext.dart'; +import '../../../helpers/style_mix_ext.dart'; import '../../../core/attributes/icon_theme_data.dart'; import '../../../core/style_scope.dart'; import '../../../helpers/mix_controller_mixin.dart'; diff --git a/lib/src/components/form/select/select_widget.dart b/lib/src/components/form/select/select_widget.dart index a3569f75..4507b700 100644 --- a/lib/src/components/form/select/select_widget.dart +++ b/lib/src/components/form/select/select_widget.dart @@ -72,10 +72,6 @@ class RxSelect extends StatefulWidget { /// Only used when [allowMultiple] is true. final ValueChanged>? onSelectedValuesChanged; - /// Whether to allow selecting multiple items. - /// When true, [selectedValues] and [onSelectedValuesChanged] must be provided. - // final bool allowMultiple; - /// Whether the select is enabled and can be interacted with. /// When false, all interaction is disabled and the trigger shows a forbidden cursor. final bool enabled; diff --git a/lib/src/components/form/switch/switch.dart b/lib/src/components/form/switch/switch.dart index 174b108a..f5a29cbe 100644 --- a/lib/src/components/form/switch/switch.dart +++ b/lib/src/components/form/switch/switch.dart @@ -3,8 +3,8 @@ import 'package:flutter/widgets.dart'; import 'package:mix/mix.dart'; import 'package:mix_annotations/mix_annotations.dart'; import 'package:naked_ui/naked_ui.dart'; -import 'package:remix/src/helpers/style_mix_ext.dart'; +import '../../../helpers/style_mix_ext.dart'; import '../../../helpers/mix_controller_mixin.dart'; import '../../../helpers/remix_builder.dart'; diff --git a/lib/src/components/form/textfield/textfield_widget.dart b/lib/src/components/form/textfield/textfield_widget.dart index d5edaf60..8d8cf474 100644 --- a/lib/src/components/form/textfield/textfield_widget.dart +++ b/lib/src/components/form/textfield/textfield_widget.dart @@ -289,8 +289,8 @@ class _RxTextFieldState extends State contentInsertionConfiguration: widget.contentInsertionConfiguration, clipBehavior: widget.clipBehavior, restorationId: widget.restorationId, - stylusHandwritingEnabled: widget.stylusHandwritingEnabled, onPressUpOutside: widget.onPressUpOutside, + stylusHandwritingEnabled: widget.stylusHandwritingEnabled, enableIMEPersonalizedLearning: widget.enableIMEPersonalizedLearning, contextMenuBuilder: widget.contextMenuBuilder, canRequestFocus: widget.canRequestFocus, diff --git a/lib/src/components/overlay/tooltip.dart b/lib/src/components/overlay/tooltip.dart index 7bc53358..a951c3da 100644 --- a/lib/src/components/overlay/tooltip.dart +++ b/lib/src/components/overlay/tooltip.dart @@ -5,7 +5,8 @@ import 'package:mix/experimental.dart'; import 'package:mix/mix.dart'; import 'package:mix_annotations/mix_annotations.dart'; import 'package:naked_ui/naked_ui.dart'; -import 'package:remix/src/helpers/style_mix_ext.dart'; + +import '../../helpers/style_mix_ext.dart'; part 'tooltip.g.dart'; part 'tooltip_style.dart'; diff --git a/lib/src/core/style_scope.dart b/lib/src/core/style_scope.dart index 1163cacb..0ad0705a 100644 --- a/lib/src/core/style_scope.dart +++ b/lib/src/core/style_scope.dart @@ -12,7 +12,7 @@ class StyleScope extends InheritedWidget { }); static StyleScope? of(BuildContext context) { - return context.dependOnInheritedWidgetOfExactType>(); + return context.dependOnInheritedWidgetOfExactType(); } final U style; diff --git a/lib/src/helpers/docs.dart b/lib/src/helpers/docs.dart index 13827191..988a506e 100644 --- a/lib/src/helpers/docs.dart +++ b/lib/src/helpers/docs.dart @@ -35,7 +35,6 @@ const _widgetSpecBuilder = ''; /// {@template remix.component.style} /// Customizes the component's appearance with unique or specific styling. /// {@endtemplate} -// const _useStyleFromContext = ''; /// /// {@template remix.component.enabled} /// When enabled, the component will respond to user interaction and will diff --git a/pubspec.lock b/pubspec.lock index 0ad1a249..d98200ce 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -165,10 +165,10 @@ packages: dependency: "direct dev" description: name: dart_code_metrics_presets - sha256: "30b7bcaec9de4e8c5f7a41eea7f8e2fa52ad30729f4435a3b4fcf460abb327fe" + sha256: f1bab78d6e02e08948bef84d637e0d19ee7122ceb4b52b9ea77fe87ec5e9e588 url: "https://pub.dev" source: hosted - version: "2.22.0" + version: "2.24.0" dart_style: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index e8ff36e0..10feb01b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -28,7 +28,7 @@ dev_dependencies: mix_generator: ^1.7.0 build_runner: ^2.4.9 flutter_lints: ^4.0.0 - dart_code_metrics_presets: ^2.22.0 + dart_code_metrics_presets: ^2.24.0 flutter: