Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support stable #3796

Merged
merged 3 commits into from
Oct 22, 2024
Merged

Support stable #3796

merged 3 commits into from
Oct 22, 2024

Conversation

rrousselGit
Copy link
Owner

@rrousselGit rrousselGit commented Oct 22, 2024

Summary by CodeRabbit

  • New Features

    • Enhanced GitHub Actions workflows for improved build and linting processes.
  • Bug Fixes

    • Downgraded custom_lint dependency across multiple projects to ensure compatibility.
    • Corrected dependency versioning for analyzer to align with Flutter's stable channel.
  • Documentation

    • Updated changelogs for various packages to reflect new versions and compatibility changes.
  • Refactor

    • Improved widget conversion logic in the riverpod_lint package for better handling of stateful and stateless widgets.

Copy link

coderabbitai bot commented Oct 22, 2024

Walkthrough

The changes encompass updates to various configuration files and dependencies across multiple Flutter projects and packages. Key modifications include adjustments to GitHub Actions workflows, specifically the addition of a stable channel option and corrections in YAML formatting. Several pubspec.yaml files reflect a downgrade of the custom_lint dependency version from ^0.6.5 to ^0.6.0. Additionally, the analyzer dependency version has been updated to ^6.7.0 in multiple files, ensuring compatibility with the latest requirements. The changelogs have been updated to reflect these changes.

Changes

File Path Change Summary
.github/workflows/build.yml Updated strategy.matrix.channel to include stable channel; removed comments; corrected YAML indentation.
.github/workflows/riverpod_lint.yml Added stable channel to strategy matrix; corrected indentation in package_path.
examples/counter/pubspec.yaml Downgraded custom_lint from ^0.6.5 to ^0.6.0.
examples/marvel/pubspec.yaml Downgraded custom_lint from ^0.6.5 to ^0.6.0.
examples/pub/pubspec.yaml Downgraded custom_lint from ^0.6.5 to ^0.6.0.
examples/random_number/pubspec.yaml Downgraded custom_lint from ^0.6.5 to ^0.6.0.
examples/stackoverflow/pubspec.yaml Downgraded custom_lint from ^0.6.5 to ^0.6.0.
examples/todos/pubspec.yaml Downgraded custom_lint from ^0.6.5 to ^0.6.0.
packages/riverpod/pubspec.yaml Updated analyzer version from ">=5.12.0 <7.0.0" to "^6.7.0".
packages/riverpod/pubspec_overrides.yaml Updated analyzer version from ^6.0.0 to ^6.7.0.
packages/riverpod_analyzer_utils/CHANGELOG.md Added support for analyzer versions >=6.7.0 <7.0.0; updated minimum analyzer version to 6.9.0.
packages/riverpod_analyzer_utils/lib/src/riverpod_ast/ref_invocation.dart Modified functionOwner determination logic.
packages/riverpod_analyzer_utils/lib/src/riverpod_ast/widget_ref_invocation.dart Modified functionOwner determination logic.
packages/riverpod_analyzer_utils/pubspec.yaml Downgraded analyzer from ^6.9.0 to ^6.7.0; downgraded custom_lint_core from ^0.6.5 to ^0.6.0.
packages/riverpod_analyzer_utils_tests/pubspec.yaml Updated analyzer version from ">=5.12.0 <7.0.0" to "^6.7.0".
packages/riverpod_generator/CHANGELOG.md Added support for analyzer version range >=6.7.0 <7.0.0; deprecated generated Ref subclasses.
packages/riverpod_generator/pubspec.yaml Updated package version to 2.6.0; updated analyzer from ^6.5.0 to ^6.7.0.
packages/riverpod_graph/lib/src/analyze.dart Modified display name retrieval logic for providers.
packages/riverpod_graph/pubspec.yaml Updated version from 0.0.1 to 0.0.2; changed analyzer from 6.9.0 to ^6.7.0.
packages/riverpod_lint/CHANGELOG.md Added support for analyzer version range >=6.7.0 <7.0.0; updated lint method signatures.
packages/riverpod_lint/lib/src/assists/convert_to_stateful_base_widget.dart Enhanced widget conversion logic.
packages/riverpod_lint/lib/src/assists/convert_to_stateless_base_widget.dart Improved widget conversion logic for stateless widgets.
packages/riverpod_lint/lib/src/lints/avoid_manual_providers_as_generated_provider_dependency.dart Updated error reporting code.
packages/riverpod_lint/lib/src/lints/provider_parameters.dart Standardized lint code reporting; improved logic for equality operator.
packages/riverpod_lint/lib/src/lints/scoped_providers_should_specify_dependencies.dart Updated error reporting mechanism.
packages/riverpod_lint/pubspec.yaml Downgraded analyzer from ^6.9.0 to ^6.7.0; downgraded custom_lint_builder from ^0.6.5 to ^0.6.0.
packages/riverpod_lint/pubspec_overrides.yaml Removed analyzer dependency override.
packages/riverpod_lint_flutter_test/pubspec.yaml Downgraded custom_lint and custom_lint_core from ^0.6.5 to ^0.6.0.
website/pubspec_overrides.yaml Updated analyzer version from ^6.0.0 to ^6.7.0.

Poem

In the garden where code does bloom,
A stable channel dispels the gloom.
With linting tools now set just right,
Our Flutter apps take joyful flight!
Dependencies dance, versions align,
In this code rabbit's world, all is fine! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@rrousselGit rrousselGit linked an issue Oct 22, 2024 that may be closed by this pull request
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (7)
website/pubspec_overrides.yaml (1)

17-17: Approved: Analyzer dependency version update

The update of the analyzer dependency to ^6.7.0 is consistent with changes in other files and aligns with the PR objective of supporting stable versions.

Consider updating or removing the comment "Needed due to Flutter not supporting 6.0.0 yet" as it's now outdated. You could either remove it or update it to explain why version 6.7.0 is specifically needed.

packages/riverpod_lint/pubspec.yaml (1)

14-17: Summary of dependency changes and their impact

The changes to analyzer and custom_lint_builder dependencies appear to be part of a broader update across multiple packages in the project. While this consistency is good for maintaining compatibility between packages, it's important to consider the following:

  1. Ensure that downgrading these dependencies doesn't remove any critical features or bug fixes that your project relies on.
  2. Verify that all packages depending on riverpod_lint are compatible with these new version constraints.
  3. Update your CI/CD pipelines and development environments to reflect these changes.
  4. Consider documenting the reason for these downgrades in your project's changelog or documentation.

To maintain long-term stability and ease future upgrades, consider implementing a dependency management strategy that includes:

  • Regular reviews of dependency versions across all packages
  • A process for testing and rolling out dependency updates
  • Documentation of reasons for specific version constraints
.github/workflows/riverpod_lint.yml (1)

29-29: LGTM! Consider conditional job execution for efficiency.

Adding the 'stable' channel to the matrix strategy is a good practice. It increases test coverage across different Flutter versions, helping to catch potential issues early.

To optimize CI resources, consider adding a condition to skip certain jobs when changes are made to specific paths. For example:

jobs:
  riverpod_lint:
    # ... existing configuration ...
    if: |
      !contains(github.event.head_commit.modified, 'README.md') &&
      !contains(github.event.head_commit.modified, 'CHANGELOG.md')

This would prevent unnecessary runs for documentation-only changes.

packages/riverpod_analyzer_utils/CHANGELOG.md (1)

1-5: LGTM! Consider adding a date placeholder.

The new "Unreleased patch" section is well-structured and provides clear information about the analyzer version support and its implications for Flutter compatibility. This is valuable for users and follows changelog best practices.

Consider adding a date placeholder (e.g., ## Unreleased patch - [DATE]) to make it easier to update when releasing:

-## Unreleased patch
+## Unreleased patch - [DATE]
packages/riverpod_lint/lib/src/lints/scoped_providers_should_specify_dependencies.dart (2)

Line range hint 76-79: Address TODOs for handling parent: null cases

There are two TODO comments in the code regarding handling parent: null cases. These might be areas for future improvement.

Consider creating issues to track these TODOs:

  1. In addProviderContainerInstanceCreationExpression method (around line 76)
  2. In isProviderScopeScoped method (around line 102)

Both TODOs suggest checking if the expression's static type is non-nullable. This could enhance the lint rule's accuracy in detecting scoped providers.

Also applies to: 102-105


Line range hint 46-50: Consider extracting common logic for readability

The isFlutterRunApp and isPumpWidget methods in the SimpleIdentifierX extension share similar logic. Consider extracting the common parts into a private method to improve readability and maintainability.

Here's a suggested refactoring:

extension SimpleIdentifierX on SimpleIdentifier {
  bool _isFromPackage(String packageName) {
    final library = staticElement?.library;
    if (library == null) return false;
    final libraryUri = Uri.tryParse(library.identifier);
    if (libraryUri == null) return false;

    return libraryUri.scheme == 'package' &&
        libraryUri.pathSegments.first == packageName;
  }

  bool get isFlutterRunApp => name == 'runApp' && _isFromPackage('flutter');

  bool get isPumpWidget => name == 'pumpWidget' && _isFromPackage('flutter_test');
}

This refactoring reduces code duplication and makes it easier to add similar checks in the future.

packages/riverpod_lint/CHANGELOG.md (1)

1-5: LGTM! Consider adding the release date.

The new changelog entry for version 2.6.1 is well-formatted and provides clear information about the changes. It correctly mentions the support for the analyzer version range and its compatibility with Flutter's stable channel, which aligns with the PR objectives.

Consider adding a placeholder for the release date:

-## Unreleased 2.6.1
+## 2.6.1 - Unreleased

This will make it easier to add the actual release date when the version is published.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 305b92d and e38b9d3.

📒 Files selected for processing (29)
  • .github/workflows/build.yml (1 hunks)
  • .github/workflows/riverpod_lint.yml (1 hunks)
  • examples/counter/pubspec.yaml (1 hunks)
  • examples/marvel/pubspec.yaml (1 hunks)
  • examples/pub/pubspec.yaml (1 hunks)
  • examples/random_number/pubspec.yaml (1 hunks)
  • examples/stackoverflow/pubspec.yaml (1 hunks)
  • examples/todos/pubspec.yaml (1 hunks)
  • packages/riverpod/pubspec.yaml (1 hunks)
  • packages/riverpod/pubspec_overrides.yaml (1 hunks)
  • packages/riverpod_analyzer_utils/CHANGELOG.md (2 hunks)
  • packages/riverpod_analyzer_utils/lib/src/riverpod_ast/ref_invocation.dart (1 hunks)
  • packages/riverpod_analyzer_utils/lib/src/riverpod_ast/widget_ref_invocation.dart (1 hunks)
  • packages/riverpod_analyzer_utils/pubspec.yaml (1 hunks)
  • packages/riverpod_analyzer_utils_tests/pubspec.yaml (1 hunks)
  • packages/riverpod_generator/CHANGELOG.md (1 hunks)
  • packages/riverpod_generator/pubspec.yaml (1 hunks)
  • packages/riverpod_graph/lib/src/analyze.dart (1 hunks)
  • packages/riverpod_graph/pubspec.yaml (1 hunks)
  • packages/riverpod_lint/CHANGELOG.md (1 hunks)
  • packages/riverpod_lint/lib/src/assists/convert_to_stateful_base_widget.dart (1 hunks)
  • packages/riverpod_lint/lib/src/assists/convert_to_stateless_base_widget.dart (1 hunks)
  • packages/riverpod_lint/lib/src/lints/avoid_manual_providers_as_generated_provider_dependency.dart (1 hunks)
  • packages/riverpod_lint/lib/src/lints/provider_parameters.dart (1 hunks)
  • packages/riverpod_lint/lib/src/lints/scoped_providers_should_specify_dependencies.dart (1 hunks)
  • packages/riverpod_lint/pubspec.yaml (1 hunks)
  • packages/riverpod_lint/pubspec_overrides.yaml (0 hunks)
  • packages/riverpod_lint_flutter_test/pubspec.yaml (1 hunks)
  • website/pubspec_overrides.yaml (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/riverpod_lint/pubspec_overrides.yaml
✅ Files skipped from review due to trivial changes (2)
  • packages/riverpod/pubspec_overrides.yaml
  • packages/riverpod_generator/pubspec.yaml
🧰 Additional context used
🔇 Additional comments (28)
examples/random_number/pubspec.yaml (1)

17-17: Verify the reason for downgrading custom_lint dependency.

The custom_lint dependency has been downgraded from ^0.6.5 to ^0.6.0. This change aligns with similar updates across multiple projects in this pull request. Could you please clarify the reason for this downgrade? It's important to ensure that this change doesn't introduce any compatibility issues or affect the project's functionality.

To ensure this change doesn't break anything, please run the following commands:

If any issues arise during these checks, please address them before merging this change.

packages/riverpod_graph/pubspec.yaml (1)

14-14: Approve the analyzer dependency update, but verify compatibility.

The change from analyzer: "6.9.0" to analyzer: ^6.7.0 provides more flexibility for minor updates and aligns with changes in other packages. However, please note:

  1. This change potentially allows for a downgrade from 6.9.0 to 6.7.0.
  2. Ensure that the package is compatible with analyzer versions 6.7.0 through 6.9.0.

To verify the impact of this change, please run the following script:

examples/stackoverflow/pubspec.yaml (1)

22-22: Verify the impact of downgrading custom_lint.

The downgrade of custom_lint from ^0.6.5 to ^0.6.0 is consistent with changes across multiple projects in this PR. This aligns with the PR objective of "Support stable".

To ensure this change doesn't negatively impact the development process:

  1. Verify that all projects using custom_lint have been updated consistently:

  2. Check if there are any breaking changes or important fixes in the versions being skipped:

Consider adding a comment in the pubspec.yaml file or updating the project's documentation to explain the reason for this specific version constraint, which will help future maintainers understand the decision.

✅ Verification successful

Downgrade of custom_lint to version ^0.6.0 has been verified and is consistent across all projects. This ensures alignment with the PR objective of supporting stability.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for consistent custom_lint version across all pubspec.yaml files

# Test: Verify custom_lint version. Expect: All occurrences should be ^0.6.0
rg -g 'pubspec.yaml' 'custom_lint:' --no-filename | sort | uniq -c

Length of output: 94


Script:

#!/bin/bash
# Description: Fetch the changelog for custom_lint

# Test: Check for breaking changes or important fixes between 0.6.0 and 0.6.5
curl -s https://raw.githubusercontent.com/invertase/dart_custom_lint/main/packages/custom_lint/CHANGELOG.md | sed -n '/## 0.6.5/,/## 0.6.0/p'

Length of output: 846

packages/riverpod/pubspec.yaml (1)

22-22: LGTM! Verify analyzer compatibility across the project.

The update to the analyzer dependency version looks good. It narrows down the acceptable range to ^6.7.0, which should improve stability and ensure compatibility with the latest features in the 6.x range.

To ensure consistency across the project, please run the following script to verify that all references to the analyzer package use the same version constraint:

This will help ensure that the analyzer version is consistently updated across all relevant files in the project.

✅ Verification successful

Analyzer version consistently updated across all pubspec files.

All relevant pubspec.yaml files now use analyzer: ^6.7.0, ensuring uniformity and improved stability throughout the project.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for consistent analyzer version across the project

# Search for analyzer version specifications in pubspec files
echo "Checking analyzer versions in pubspec files:"
rg -g 'pubspec*.yaml' 'analyzer:' -A 1

# Search for analyzer version specifications in workflow files
echo "\nChecking analyzer versions in workflow files:"
rg -g '*.yml' -g '*.yaml' 'uses: dart-lang/setup-dart@' -A 1

Length of output: 1219

packages/riverpod_analyzer_utils/pubspec.yaml (2)

16-16: Verify the reason for downgrading the custom_lint_core dependency.

The custom_lint_core dependency has been downgraded from ^0.6.5 to ^0.6.0. While this aligns with changes in other packages, it's important to ensure this doesn't remove any necessary features or bug fixes.

Could you please confirm:

  1. The reason for this downgrade?
  2. That all features required by this package are still supported in version 0.6.0?
  3. That this change doesn't reintroduce any known bugs or issues that were fixed in versions 0.6.1 to 0.6.5?
#!/bin/bash
# Description: Check for any usage of custom_lint_core features that might be affected by the downgrade

# Test: Search for custom_lint_core usage in the codebase
rg -p 'import .+custom_lint_core' -g '!pubspec.yaml'

13-13: Verify the reason for downgrading the analyzer dependency.

The analyzer dependency has been downgraded from ^6.9.0 to ^6.7.0. While this aligns with changes in other packages, it's important to ensure this doesn't introduce any compatibility issues or remove necessary features.

Could you please confirm:

  1. The reason for this downgrade?
  2. That all features required by this package are still supported in version 6.7.0?
  3. That this change doesn't introduce any known bugs or issues?
✅ Verification successful

Downgrade of analyzer dependency verified as safe. No usage of analyzer found in the codebase that would be affected by this change.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any usage of analyzer features that might be affected by the downgrade

# Test: Search for analyzer usage in the codebase
rg -p 'import .+analyzer' -g '!pubspec.yaml'

Length of output: 287

examples/pub/pubspec.yaml (1)

26-26: Please clarify the rationale for downgrading custom_lint.

The version of custom_lint has been downgraded from ^0.6.5 to ^0.6.0. While this change is consistent across multiple projects in this PR, downgrading dependencies is unusual and may have implications.

  1. Could you explain the reasons for this downgrade?
  2. Have you verified that this version is compatible with other dependencies in the project?
  3. If not already done, please update the changelog to reflect this change.

To ensure all related files have been updated consistently, please run the following script:

This will help us confirm that the change has been applied uniformly across the project.

✅ Verification successful

Consistency Verified: custom_lint version is uniformly set to ^0.6.0 across all pubspec.yaml files.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for consistent custom_lint version across all pubspec.yaml files

# Test: Verify custom_lint version in all pubspec.yaml files
rg -A 5 'custom_lint:' $(fd -e yaml pubspec)

Length of output: 4658

examples/todos/pubspec.yaml (1)

21-21: Acknowledge downgrade of custom_lint and request clarification.

The custom_lint dependency has been downgraded from ^0.6.5 to ^0.6.0. This change is consistent across multiple projects in this PR.

  1. Could you please clarify the reason for this downgrade?
  2. Are there any known compatibility issues with the newer version?
  3. How does this affect the project's linting capabilities?

To ensure this change doesn't negatively impact the project, please run the following script:

This will help verify that the linting still functions as expected with the older version.

packages/riverpod_lint/pubspec.yaml (2)

17-17: Confirm compatibility with downgraded custom_lint_builder version

The custom_lint_builder dependency has been downgraded from ^0.6.5 to ^0.6.0. This change is consistent with updates in other packages within the project. However, it's important to verify that this downgrade doesn't remove any necessary features or bug fixes introduced in versions 0.6.1 to 0.6.5.

To check for any potential issues, run the following script:

#!/bin/bash
# Description: Check for usage of custom_lint_builder features introduced in versions 0.6.1 to 0.6.5

# Test: Search for any imports or usages of the custom_lint_builder package
rg -i 'import.*custom_lint_builder' --type dart
rg -i 'custom_lint_builder\.' --type dart

If the script returns results, review them to ensure no newer features are being used that might be incompatible with version 0.6.0.


14-14: Verify compatibility with downgraded analyzer version

The analyzer dependency has been downgraded from ^6.9.0 to ^6.7.0. This change aligns with updates in other packages within the project, which is good for consistency. However, please ensure that this downgrade doesn't impact any features or bug fixes you might have been relying on from versions 6.8.x and 6.9.x.

To check for any potential issues, run the following script:

If the script returns results, review them to ensure no newer features are being used that might be incompatible with version 6.7.0.

✅ Verification successful

Analyzer Version Downgrade Verified

The downgrade of the analyzer dependency from ^6.9.0 to ^6.7.0 does not impact the current codebase. No usages of features introduced in versions 6.8.x or 6.9.x were found.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for usage of analyzer features introduced in versions 6.8.x and 6.9.x

# Test: Search for any imports or usages of the analyzer package
rg -i 'import.*analyzer' --type dart
rg -i 'analyzer\.' --type dart

Length of output: 9281


Script:

#!/bin/bash
# Description: Check for usage of analyzer features introduced in versions 6.8.x and 6.9.x

# Test: Search for any imports or usages of the analyzer package
rg -i 'import\s+["'\'']package:analyzer' --type dart
rg -i 'analyzer\.' --type dart

Length of output: 12772

packages/riverpod_lint_flutter_test/pubspec.yaml (1)

18-19: Verify the impact of downgrading custom_lint dependencies.

The downgrade of custom_lint and custom_lint_core from ^0.6.5 to ^0.6.0 is consistent with changes made in other packages as mentioned in the AI summary. However, it's important to consider the following:

  1. Ensure that this downgrade doesn't introduce compatibility issues with other dependencies or the project's requirements.
  2. Verify that the features or bug fixes you need are still available in version 0.6.0.
  3. Check if this change is intentional and aligns with the PR objective of "Support stable".

To confirm the consistency of these changes across the project, run the following script:

This will help ensure that the changes are consistent across all relevant packages.

✅ Verification successful

Downgrade of custom_lint dependencies is consistent across all packages.

All instances of custom_lint and custom_lint_core are set to version ^0.6.0 across the project, ensuring consistency and alignment with the PR objective.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify custom_lint dependency versions across all pubspec.yaml files

# Test: Check custom_lint versions in all pubspec.yaml files
echo "Checking custom_lint versions:"
rg -g 'pubspec.yaml' 'custom_lint:' --no-filename

# Test: Check custom_lint_core versions in all pubspec.yaml files
echo "Checking custom_lint_core versions:"
rg -g 'pubspec.yaml' 'custom_lint_core:' --no-filename

Length of output: 460

packages/riverpod_analyzer_utils_tests/pubspec.yaml (1)

9-9: LGTM! Consider verifying compatibility.

The update of the analyzer dependency to ^6.7.0 aligns well with the PR objective to "Support stable". This change narrows down the acceptable versions, which should lead to more consistent behavior across different environments.

To ensure this change doesn't introduce any compatibility issues, please run the following script:

If the script returns any results, consider updating those packages to use compatible versions.

✅ Verification successful

Verified: All pubspec.yaml files have analyzer: ^6.7.0.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that all packages using 'analyzer' have compatible versions

# Test: Check for any incompatible 'analyzer' versions across all pubspec.yaml files
rg -g 'pubspec.yaml' 'analyzer:' | grep -v '^6.7.0'

Length of output: 406

examples/marvel/pubspec.yaml (1)

25-25: Confirm the rationale for downgrading custom_lint.

The custom_lint dependency has been downgraded from ^0.6.5 to ^0.6.0. This change is consistent with the modifications made in other projects as mentioned in the summary.

Could you please confirm the reason for this downgrade? It's generally recommended to use the latest stable versions of dependencies unless there are specific compatibility issues or requirements.

To verify the impact of this change, you can run the following script:

This script will help identify any potential issues or reasons for the downgrade by examining the release notes and searching for relevant references in the project.

examples/counter/pubspec.yaml (1)

27-27: LGTM. Please verify compatibility and document version choice.

The downgrade of custom_lint from ^0.6.5 to ^0.6.0 is consistent with changes in other projects mentioned in the summary. This change looks good, but please ensure:

  1. This version is compatible with other dependencies in the project.
  2. The specific reason for choosing version 0.6.0 is documented, either in the commit message or in a comment in this file.

To verify compatibility, please run the following command and ensure there are no conflicts:

packages/riverpod_lint/lib/src/lints/avoid_manual_providers_as_generated_provider_dependency.dart (1)

33-33: LGTM: Consistent use of private _code variable

The change from code to _code aligns with the lint rule's declaration and improves consistency. This modification ensures that the correct lint code is used when reporting errors related to provider dependencies.

To ensure this change is consistent across the codebase, let's run the following script:

✅ Verification successful
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistent use of '_code' instead of 'code' in lint files

# Test: Search for remaining instances of 'code' in lint files
echo "Searching for remaining instances of 'code' in lint files:"
rg '\bcode\b' packages/riverpod_lint/lib/src/lints --type dart

# Test: Confirm the use of '_code' in lint files
echo "Confirming the use of '_code' in lint files:"
rg '\b_code\b' packages/riverpod_lint/lib/src/lints --type dart

Length of output: 8938

.github/workflows/build.yml (1)

31-31: LGTM: Addition of 'stable' channel improves test coverage

The inclusion of the 'stable' channel in the matrix strategy is a positive change. It ensures that the project is tested against both the stable and master Flutter channels, which can help identify compatibility issues early in the development process.

Let's verify the complete matrix configuration:

✅ Verification successful

LGTM: Verified matrix configuration and code structure

  • Both 'stable' and 'master' channels are present in the matrix strategy.
  • 'examples/marvel' is correctly indented at line 35.
  • No residual comments about 'WidgetStateProperty' found.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the complete matrix configuration in the workflow file

# Test: Check for both 'stable' and 'master' channels
echo "Checking for 'stable' and 'master' channels:"
grep -A2 "channel:" .github/workflows/build.yml

# Test: Verify the indentation of 'examples/marvel' in the package_path list
echo "Checking indentation of 'examples/marvel':"
grep -n "examples/marvel" .github/workflows/build.yml

# Test: Check for any remaining comments about WidgetStateProperty
echo "Checking for comments about WidgetStateProperty:"
grep "WidgetStateProperty" .github/workflows/build.yml

Length of output: 702

packages/riverpod_lint/lib/src/lints/provider_parameters.dart (4)

40-40: LGTM: Consistent use of _code

The change from code to _code aligns with the class constructor and improves consistency in using the private constant for the lint code.


43-43: LGTM: Consistent use of _code

This change maintains consistency with the previous modification, ensuring uniform usage of the private _code constant for lint reporting.


Line range hint 1-89: Overall assessment: Improvements in consistency and null-safety

The changes in this file primarily focus on two aspects:

  1. Consistent use of the private _code constant for lint reporting.
  2. Updates to element access methods and improved null-safety checks.

These modifications enhance the code's consistency and robustness. The only point of attention is to ensure that the change from enclosingElement3 to enclosingElement is compatible with the current analyzer version being used.

No new issues have been introduced, and the overall functionality of the ProviderParameters lint rule appears to be maintained.


49-58: Verify API change and approve null-safe improvements

  1. The change from enclosingElement3 to enclosingElement suggests a possible API update in the analyzer package. Please verify that this change is compatible with the current version of the analyzer being used.

  2. The introduction of isEqualFromObjectMethod improves null-safety and provides a more explicit check for whether the == method is from the Object class. This is a good improvement in code clarity and safety.

  3. The use of _code in the error reporting is consistent with previous changes.

These changes appear to enhance the code's robustness and clarity. However, it's important to ensure that the analyzer API change is intentional and compatible.

To verify the analyzer API change, please run the following command:

packages/riverpod_lint/lib/src/lints/scoped_providers_should_specify_dependencies.dart (2)

Line range hint 1-138: Overall assessment: Good quality with minor improvement suggestions

The changes made to this file are appropriate and align with the broader updates in the package. The existing code is well-structured and follows good practices. The suggestions provided are for future improvements and do not impact the current functionality of the lint rule.


61-61: Consistent use of _code instead of code

The change from code to _code aligns with the standardization of lint reporting mechanism mentioned in the summary. This modification enhances consistency across the riverpod_lint package.

Let's verify if this change is consistent across the codebase:

✅ Verification successful

Change to _code is consistent across the codebase

The replacement of code with _code has been thoroughly verified across the riverpod_lint package, ensuring consistent use in the lint reporting mechanism.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining usages of 'code' in lint reporting

# Test 1: Search for remaining instances of 'reporter.atNode' using 'code'
echo "Checking for remaining 'reporter.atNode(code)' instances:"
rg 'reporter\.atNode\([^,]+,\s*code\b' packages/riverpod_lint/lib/src/lints

# Test 2: Verify the usage of '_code' in other lint files
echo "Verifying '_code' usage in other lint files:"
rg 'reporter\.atNode\([^,]+,\s*_code\b' packages/riverpod_lint/lib/src/lints

Length of output: 2103

packages/riverpod_generator/CHANGELOG.md (1)

1-5: LGTM! The changelog entry is clear and informative.

The new changelog entry for version 2.6.1 is well-formatted and provides clear information about the changes:

  1. It correctly specifies the version as "Unreleased 2.6.1".
  2. It clearly states the new analyzer version support range.
  3. It provides context for why this change is important (compatibility with Flutter's stable channel).

This aligns well with the PR objectives and the AI-generated summary, which mentioned updates to dependencies and support for the stable channel.

packages/riverpod_analyzer_utils/lib/src/riverpod_ast/ref_invocation.dart (1)

24-24: Verify compatibility with the latest analyzer version.

The change from enclosingElement3 to enclosingElement suggests an update to align with a newer version of the analyzer package. This modification appears to be part of a broader update across the codebase.

To ensure compatibility and correct functionality, please run the following verification script:

This script will help confirm that:

  1. The analyzer version is up-to-date.
  2. All instances of enclosingElement3 have been replaced.
  3. The new enclosingElement property is consistently used across the codebase.

Please review the script output to ensure the change has been applied consistently and that there are no compatibility issues with the current analyzer version.

✅ Verification successful

Verification Successful: All instances of enclosingElement3 have been replaced with enclosingElement.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the analyzer version and usage of enclosingElement

# Check the analyzer version in pubspec.yaml
echo "Analyzer version:"
grep "analyzer:" pubspec.yaml

# Check for any remaining usage of enclosingElement3
echo "Checking for any remaining usage of enclosingElement3:"
rg "enclosingElement3" --type dart

# Verify that all occurrences have been updated to enclosingElement
echo "Verifying updated usage to enclosingElement:"
rg "enclosingElement(?!3)" --type dart

Length of output: 609


Script:

#!/bin/bash
# Description: Verify the analyzer version and usage of enclosingElement

# Check the analyzer version in pubspec.yaml
echo "Analyzer version:"
grep "analyzer:" pubspec.yaml

# Check for any remaining usage of enclosingElement3
echo "Checking for any remaining usage of enclosingElement3:"
rg "enclosingElement3" --type dart

# Verify that all occurrences have been updated to enclosingElement without '3' suffix
echo "Verifying updated usage to enclosingElement without '3':"
rg --pcre2 "enclosingElement(?!3)" --type dart

Length of output: 2063

packages/riverpod_analyzer_utils/lib/src/riverpod_ast/widget_ref_invocation.dart (1)

29-29: LGTM. Verify impact on function owner identification.

The change from enclosingElement3 to enclosingElement aligns with similar modifications in other parts of the codebase. This consistency is good for maintainability.

Please ensure that this change doesn't alter the intended behavior of identifying the function owner. You may want to:

  1. Verify that enclosingElement provides the same or correct information as previously obtained from enclosingElement3.
  2. Update any related documentation or comments if they reference the old property name.

To assist with verification, you can run the following script to check for any remaining uses of enclosingElement3 in the codebase:

This will help ensure that all instances have been updated consistently.

packages/riverpod_graph/lib/src/analyze.dart (1)

686-686: LGTM! Verify impact on provider naming.

The change from enclosingElement3 to enclosingElement looks correct and aligns with the updated analyzer package (version ^6.7.0). This modification ensures compatibility with the new API.

To ensure this change doesn't affect provider naming across the codebase, run the following script:

✅ Verification successful

Verified: Provider naming remains correct.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining usage of 'enclosingElement3' and verify 'enclosingElement' usage.

# Test 1: Check for any remaining usage of 'enclosingElement3'
echo "Checking for any remaining usage of 'enclosingElement3':"
rg "enclosingElement3" --type dart

# Test 2: Verify correct usage of 'enclosingElement'
echo "Verifying correct usage of 'enclosingElement':"
rg "enclosingElement\s*\?" --type dart

# Test 3: Check for any provider name generation issues
echo "Checking for potential provider name generation issues:"
rg "displayNameForProvider|_ProviderName" --type dart -A 10 -B 5

Length of output: 12933

packages/riverpod_lint/lib/src/assists/convert_to_stateful_base_widget.dart (1)

294-294: Code change looks good

The updated condition accurately checks whether the element's enclosing element is the widgetClassElement, which is appropriate for determining if the element should be modified or moved.

packages/riverpod_lint/lib/src/assists/convert_to_stateless_base_widget.dart (1)

336-336: LGTM!

The added condition ensures that only elements belonging to widgetClassElement are considered, improving the accuracy of the visitor.

Copy link

codecov bot commented Oct 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (feac6ad) to head (1944682).
Report is 55 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #3796      +/-   ##
===========================================
+ Coverage   95.76%   100.00%   +4.23%     
===========================================
  Files          53         3      -50     
  Lines        2312        74    -2238     
===========================================
- Hits         2214        74    -2140     
+ Misses         98         0      -98     
Flag Coverage Δ
?

Flags with carried forward coverage won't be shown. Click here to find out more.

see 51 files with indirect coverage changes

@rrousselGit rrousselGit merged commit 2876c7f into master Oct 22, 2024
49 checks passed
@rrousselGit rrousselGit deleted the support-stable branch October 22, 2024 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

riverpod_generator : warnings in 2.4.3 - No way to use 2.6.0
1 participant