From 38a0366520438b480c3c421a9563c0d3383e8b54 Mon Sep 17 00:00:00 2001 From: Remi Rousselet Date: Sun, 15 Sep 2024 01:32:01 +0200 Subject: [PATCH] Fix CI --- packages/riverpod_analyzer_utils/CHANGELOG.md | 4 ++++ .../lib/src/riverpod_ast/ref_invocation.dart | 2 +- .../lib/src/riverpod_ast/widget_ref_invocation.dart | 2 +- packages/riverpod_analyzer_utils/pubspec.yaml | 2 +- packages/riverpod_graph/lib/src/analyze.dart | 2 +- packages/riverpod_graph/pubspec.yaml | 2 +- packages/riverpod_lint/CHANGELOG.md | 4 ++++ .../lib/src/assists/convert_to_stateful_base_widget.dart | 2 +- .../lib/src/assists/convert_to_stateless_base_widget.dart | 2 +- packages/riverpod_lint/lib/src/lints/provider_parameters.dart | 4 ++-- packages/riverpod_lint/pubspec.yaml | 2 +- 11 files changed, 18 insertions(+), 10 deletions(-) diff --git a/packages/riverpod_analyzer_utils/CHANGELOG.md b/packages/riverpod_analyzer_utils/CHANGELOG.md index 87856e23f..d15b445d8 100644 --- a/packages/riverpod_analyzer_utils/CHANGELOG.md +++ b/packages/riverpod_analyzer_utils/CHANGELOG.md @@ -1,3 +1,7 @@ +## Unreleased patch + +Bumped minimum analyzer to 6.9.0 + ## 0.5.4 - 2024-08-15 Bump custom_lint diff --git a/packages/riverpod_analyzer_utils/lib/src/riverpod_ast/ref_invocation.dart b/packages/riverpod_analyzer_utils/lib/src/riverpod_ast/ref_invocation.dart index 5d10f567e..44adc4c45 100644 --- a/packages/riverpod_analyzer_utils/lib/src/riverpod_ast/ref_invocation.dart +++ b/packages/riverpod_analyzer_utils/lib/src/riverpod_ast/ref_invocation.dart @@ -21,7 +21,7 @@ abstract class RefInvocation extends RiverpodAst final functionOwner = function.staticElement .cast() ?.declaration - .enclosingElement; + .enclosingElement3; if (functionOwner == null || // Since Ref is sealed, checking that the function is from the package:riverpod diff --git a/packages/riverpod_analyzer_utils/lib/src/riverpod_ast/widget_ref_invocation.dart b/packages/riverpod_analyzer_utils/lib/src/riverpod_ast/widget_ref_invocation.dart index d154dec47..79b3ce5d8 100644 --- a/packages/riverpod_analyzer_utils/lib/src/riverpod_ast/widget_ref_invocation.dart +++ b/packages/riverpod_analyzer_utils/lib/src/riverpod_ast/widget_ref_invocation.dart @@ -26,7 +26,7 @@ abstract class WidgetRefInvocation extends RiverpodAst final functionOwner = function.staticElement .cast() ?.declaration - .enclosingElement; + .enclosingElement3; if (functionOwner == null || // Since Ref is sealed, checking that the function is from the package:riverpod diff --git a/packages/riverpod_analyzer_utils/pubspec.yaml b/packages/riverpod_analyzer_utils/pubspec.yaml index 8be5c7cb1..55367dc5a 100644 --- a/packages/riverpod_analyzer_utils/pubspec.yaml +++ b/packages/riverpod_analyzer_utils/pubspec.yaml @@ -10,7 +10,7 @@ environment: sdk: ">=3.0.0 <4.0.0" dependencies: - analyzer: ^6.5.0 + analyzer: ^6.9.0 collection: ^1.16.0 crypto: ^3.0.2 custom_lint_core: ^0.6.5 diff --git a/packages/riverpod_graph/lib/src/analyze.dart b/packages/riverpod_graph/lib/src/analyze.dart index 3905477f3..b65d298e7 100644 --- a/packages/riverpod_graph/lib/src/analyze.dart +++ b/packages/riverpod_graph/lib/src/analyze.dart @@ -683,7 +683,7 @@ class _ProviderName { /// Returns the name of the provider. _ProviderName _displayNameForProvider(VariableElement provider) { final providerName = provider.name; - final enclosingElementName = provider.enclosingElement?.displayName; + final enclosingElementName = provider.enclosingElement3?.displayName; return _ProviderName( providerName: providerName, enclosingElementName: enclosingElementName ?? '', diff --git a/packages/riverpod_graph/pubspec.yaml b/packages/riverpod_graph/pubspec.yaml index 0c7db8b4f..75b957341 100644 --- a/packages/riverpod_graph/pubspec.yaml +++ b/packages/riverpod_graph/pubspec.yaml @@ -11,7 +11,7 @@ environment: sdk: ">=2.15.0 <4.0.0" dependencies: - analyzer: ">=5.12.0 <7.0.0" + analyzer: "6.9.0" args: ^2.4.0 collection: ^1.0.0 path: ^1.8.2 diff --git a/packages/riverpod_lint/CHANGELOG.md b/packages/riverpod_lint/CHANGELOG.md index a178a2e83..5a076ce36 100644 --- a/packages/riverpod_lint/CHANGELOG.md +++ b/packages/riverpod_lint/CHANGELOG.md @@ -1,3 +1,7 @@ +## Unreleased patch + +Bump analyzer to ^6.9.0 + ## 2.3.13 - 2024-08-15 Bump custom_lint diff --git a/packages/riverpod_lint/lib/src/assists/convert_to_stateful_base_widget.dart b/packages/riverpod_lint/lib/src/assists/convert_to_stateful_base_widget.dart index a7ab884d6..8647482b9 100644 --- a/packages/riverpod_lint/lib/src/assists/convert_to_stateful_base_widget.dart +++ b/packages/riverpod_lint/lib/src/assists/convert_to_stateful_base_widget.dart @@ -291,7 +291,7 @@ class _ReplacementEditBuilder extends RecursiveAstVisitor { } final element = node.staticElement; if (element is ExecutableElement && - element.enclosingElement == widgetClassElement && + element.enclosingElement3 == widgetClassElement && !elementsToMove.contains(element)) { final offset = node.offset; final qualifier = diff --git a/packages/riverpod_lint/lib/src/assists/convert_to_stateless_base_widget.dart b/packages/riverpod_lint/lib/src/assists/convert_to_stateless_base_widget.dart index 8f6e07af4..372d0e0d1 100644 --- a/packages/riverpod_lint/lib/src/assists/convert_to_stateless_base_widget.dart +++ b/packages/riverpod_lint/lib/src/assists/convert_to_stateless_base_widget.dart @@ -333,7 +333,7 @@ class _ReplacementEditBuilder extends RecursiveAstVisitor { } final element = node.staticElement; if (element is ExecutableElement && - element.enclosingElement == widgetClassElement && + element.enclosingElement3 == widgetClassElement && !elementsToMove.contains(element)) { final parent = node.parent; if (parent is PrefixedIdentifier) { diff --git a/packages/riverpod_lint/lib/src/lints/provider_parameters.dart b/packages/riverpod_lint/lib/src/lints/provider_parameters.dart index 1a0cfbe2c..d28c9ef0d 100644 --- a/packages/riverpod_lint/lib/src/lints/provider_parameters.dart +++ b/packages/riverpod_lint/lib/src/lints/provider_parameters.dart @@ -46,9 +46,9 @@ class ProviderParameters extends RiverpodLintRule { ?.applyRedirectedConstructors(); final operatorEqual = - instantiatedObject?.enclosingElement.recursiveGetMethod('=='); + instantiatedObject?.enclosingElement3.recursiveGetMethod('=='); - final isEqualFromObjectMethod = operatorEqual?.enclosingElement + final isEqualFromObjectMethod = operatorEqual?.enclosingElement3 .safeCast() ?.thisType .isDartCoreObject; diff --git a/packages/riverpod_lint/pubspec.yaml b/packages/riverpod_lint/pubspec.yaml index 36669250e..30a62bae9 100644 --- a/packages/riverpod_lint/pubspec.yaml +++ b/packages/riverpod_lint/pubspec.yaml @@ -11,7 +11,7 @@ environment: sdk: ">=2.17.0 <4.0.0" dependencies: - analyzer: ^6.5.0 + analyzer: ^6.9.0 analyzer_plugin: ^0.11.2 collection: ^1.16.0 custom_lint_builder: ^0.6.5