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

Update custom_lint #1147

Closed
wants to merge 1 commit into from
Closed

Conversation

lishaduck
Copy link
Contributor

@lishaduck lishaduck commented Jan 7, 2025

Closes #1141

Example folder golden passes on both flutter stable and master channels (for me).

Summary by CodeRabbit

  • Dependency Updates

    • Updated analyzer to version 6.6.0
    • Updated custom_lint_builder to version 0.7.0
    • Updated custom_lint to version 0.7.0
  • Analysis Options

    • Enhanced type checking by enabling strict analysis options for casts, inference, and raw types

Copy link

coderabbitai bot commented Jan 7, 2025

Walkthrough

This pull request updates the freezed_lint package to support custom_lint version 0.7.0. The changes involve updating dependency versions in the pubspec.yaml file, adding strict analysis options in the analysis_options.yaml file, and documenting the version update in the changelog. The modifications aim to maintain version consistency across the package's dependencies.

Changes

File Change Summary
packages/freezed_lint/CHANGELOG.md Added unreleased patch section for custom_lint version 0.7.0
packages/freezed_lint/analysis_options.yaml Added strict analysis options: strict-casts, strict-inference, and strict-raw-types
packages/freezed_lint/pubspec.yaml Updated dependency versions:
- analyzer: ^6.5.0^6.6.0
- custom_lint_builder: ^0.6.0^0.7.0
- custom_lint: ^0.6.0^0.7.0

Assessment against linked issues

Objective Addressed Explanation
Update custom_lint_builder to 0.7.0
Support custom_lint 0.7.0

Possibly related PRs

  • CI #1145: Similar changelog update for analyzer version 7.0.0

Poem

🐰 Hop, hop, version update time!
Dependencies dancing in line
Custom Lint leaps to point seven
Strict options make our code a haven
Consistency is our design divine! 🚀


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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 175b25d and 65bf05e.

⛔ Files ignored due to path filters (1)
  • packages/_internal/pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • packages/freezed_lint/CHANGELOG.md (1 hunks)
  • packages/freezed_lint/analysis_options.yaml (0 hunks)
  • packages/freezed_lint/pubspec.yaml (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/freezed_lint/analysis_options.yaml
✅ Files skipped from review due to trivial changes (1)
  • packages/freezed_lint/CHANGELOG.md
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: freezed (packages/freezed_lint, master, get)
  • GitHub Check: freezed (packages/freezed_annotation, master, get)
  • GitHub Check: freezed (packages/freezed, master, get)
🔇 Additional comments (2)
packages/freezed_lint/pubspec.yaml (2)

18-18: LGTM! Consistent version update

The custom_lint version update matches the custom_lint_builder version, maintaining consistency between the packages.


14-14: Verify custom_lint_builder version compatibility

The update to custom_lint_builder 0.7.0 is a minor version bump in a 0.x.x range, which may contain breaking changes. This aligns with the PR objectives to update custom_lint support.

Let's verify the changes and compatibility:

✅ Verification successful

Version update to custom_lint_builder ^0.7.0 is appropriate

The update is explicitly documented in the changelog as a compatibility update to support custom_lint v0.7.0, and both dependencies (custom_lint and custom_lint_builder) are consistently updated to the same version.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check custom_lint_builder changes and compatibility

# Get the custom_lint_builder package info
curl -s https://pub.dev/packages/custom_lint_builder.json | jq -r '.versions[] | select(.version | startswith("0.7.")) | .version'

# Check if any packages in the repository depend on a conflicting custom_lint_builder version
rg -l "custom_lint_builder:" | xargs cat | rg "custom_lint_builder: [\"'^].*[\"'\$]" || echo "No other custom_lint_builder dependencies found"

Length of output: 393


Script:

#!/bin/bash
# Try alternative approach to check package information and changes

# Check for CHANGELOG.md in the repository
fd -g "CHANGELOG.md" --exec grep -l "custom_lint" {} \;

# Check pubspec.lock for current version constraints
fd -g "pubspec.lock" --exec grep -A 5 "custom_lint_builder:" {} \;

# Check any migration guides or documentation
fd -g "README.md" --exec grep -B 2 -A 2 "custom_lint" {} \;

Length of output: 705


Script:

#!/bin/bash
# Check changelog content for version-related information

# Read the changelog content
cat packages/freezed_lint/CHANGELOG.md

# Check for any version-specific documentation
rg -B 2 -A 2 "0.7.0" packages/freezed_lint/

Length of output: 1490

@@ -9,12 +9,12 @@ environment:
sdk: ">=3.0.0 <4.0.0"

dependencies:
analyzer: ^6.5.0
analyzer: ^6.6.0
Copy link

@coderabbitai coderabbitai bot Jan 7, 2025

Choose a reason for hiding this comment

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

💡 Codebase verification

⚠️ Version conflict with freezed package

The proposed analyzer version ^6.6.0 conflicts with the requirement in packages/freezed/pubspec.yaml which needs ">=7.0.0 <8.0.0". Consider updating to a compatible version that satisfies the >=7.0.0 constraint.

  • packages/freezed/pubspec.yaml already supports and requires analyzer >=7.0.0
  • packages/freezed/CHANGELOG.md explicitly mentions support for analyzer 7.0.0
🔗 Analysis chain

Verify analyzer version compatibility

The minor version bump of the analyzer package should be verified for compatibility with other dependencies and potential breaking changes.

Let's check the analyzer's changelog and verify compatibility:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check analyzer package compatibility and changelog

# Get the analyzer package info and changelog
curl -s https://pub.dev/packages/analyzer.json | jq -r '.versions[] | select(.version | startswith("6.6.")) | .version'

# Check if any packages in the repository depend on a conflicting analyzer version
rg -l "analyzer:" | xargs cat | rg "analyzer: [\"'^].*[\"'\$]" || echo "No other analyzer dependencies found"

Length of output: 284


Script:

#!/bin/bash
# Find the specific file with the analyzer version >=7.0.0
rg -l "analyzer: \"\>=7\.0\.0" || rg -l "analyzer: '>="

# Also check custom_lint dependency as it might be related
rg "custom_lint:" -A 1

Length of output: 418


Script:

#!/bin/bash
# Find files containing analyzer version with simpler pattern
rg -p "analyzer.*7\.0\.0"

Length of output: 145

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, 'lil bot... good point, I guess.
Blocked on invertase/dart_custom_lint#300.

Copy link

Choose a reason for hiding this comment

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

@lishaduck I see - the issue is about upgrading multiple dependencies including analyzer, analyzer_plugin, and source_gen. This explains the version constraint situation. We'll need to wait for that upgrade to be completed in custom_lint before we can align the analyzer versions here.

🔗 Analysis chain

@lishaduck Understood, thanks for clarifying. The analyzer version update is blocked pending resolution of invertase/dart_custom_lint#300. We'll wait for that to be resolved first.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Fetch the GitHub issue details
gh issue view 300 --repo invertase/dart_custom_lint

Length of output: 208


✏️ Learnings added
Learnt from: lishaduck
PR: rrousselGit/freezed#1147
File: packages/freezed_lint/pubspec.yaml:12-12
Timestamp: 2025-01-07T20:51:22.467Z
Learning: The analyzer version upgrade in freezed_lint is blocked by invertase/dart_custom_lint#300 which handles the broader upgrade of analyzer, analyzer_plugin, and source_gen dependencies in custom_lint.

Learnt from: lishaduck
PR: rrousselGit/freezed#1147
File: packages/freezed_lint/pubspec.yaml:12-12
Timestamp: 2025-01-07T20:51:22.467Z
Learning: The analyzer version update to >=7.0.0 in freezed_lint package is blocked by invertase/dart_custom_lint#300, preventing alignment with freezed package's analyzer requirements.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@rrousselGit
Copy link
Owner

I've updated custom_lint to support analyzer 7. So I've updated Freezed separate to support the new custom-lint version.

But thanks!

@rrousselGit rrousselGit closed this Jan 8, 2025
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.

Update custom_lint_builder
2 participants