Skip to content

Conversation

wolfenrain
Copy link
Contributor

@wolfenrain wolfenrain commented May 26, 2025

Status

READY

Description

Getting ready for v3.8.0 of Dart. This also includes @spydon's changes from #151 (that I stole with his permission).

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

Summary by CodeRabbit

  • Chores

    • Updated Dart SDK version requirement to 3.8.0 across project and tooling.
    • Updated analysis options to use the latest linting rules and stricter code analysis.
    • Removed references to deprecated or unnecessary linter rules from documentation and configuration files.
    • Added a new analysis options configuration file with enhanced linting and formatting rules.
  • Documentation

    • Updated README to reflect changes in excluded lint rules.

@wolfenrain wolfenrain requested a review from a team as a code owner May 26, 2025 16:00
Copy link

coderabbitai bot commented May 26, 2025

Walkthrough

The changes update Dart SDK constraints to 3.8.0 in multiple configuration files, upgrade the analysis options to use very_good_analysis 9.0.0, and add a new strict analysis configuration file. Additionally, two linter rules are removed from exclusion lists in documentation and configuration files.

Changes

File(s) Change Summary
.github/workflows/tool_linter_rules.yaml
pubspec.yaml
tool/linter_rules/pubspec.yaml
Updated Dart SDK version constraint from 3.7.0 to 3.8.0.
lib/analysis_options.yaml Updated included analysis options from very_good_analysis 8.0.0 to 9.0.0.
lib/analysis_options.9.0.0.yaml Added new strict analysis options file with comprehensive linting and analyzer rules.
README.md
tool/linter_rules/exclusion_reasons.json
Removed "switch_on_type" and "unnecessary_unawaited" linter rules from exclusion lists.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant Analyzer
    participant Linter

    Developer->>Analyzer: Trigger analysis (now uses very_good_analysis 9.0.0)
    Analyzer->>Linter: Apply updated rules (from analysis_options.9.0.0.yaml)
    Linter-->>Analyzer: Report results (with stricter and updated rule set)
    Analyzer-->>Developer: Output analysis/lint results
Loading

Poem

🐇
Hopping to Dart 3.8,
With lints both strict and great!
Old rules now swept away,
Fresh analysis leads the way.
Commas trailing, code refined,
In this garden, bugs are left behind!


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ce61571 and 7d79095.

📒 Files selected for processing (1)
  • .github/workflows/tool_linter_rules.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/tool_linter_rules.yaml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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.

@wolfenrain wolfenrain mentioned this pull request May 26, 2025
7 tasks
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 cb79f4c and ce61571.

📒 Files selected for processing (7)
  • .github/workflows/tool_linter_rules.yaml (1 hunks)
  • README.md (0 hunks)
  • lib/analysis_options.9.0.0.yaml (1 hunks)
  • lib/analysis_options.yaml (1 hunks)
  • pubspec.yaml (1 hunks)
  • tool/linter_rules/exclusion_reasons.json (0 hunks)
  • tool/linter_rules/pubspec.yaml (1 hunks)
💤 Files with no reviewable changes (2)
  • tool/linter_rules/exclusion_reasons.json
  • README.md
🧰 Additional context used
🪛 GitHub Actions: ci
lib/analysis_options.yaml

[warning] 1-1: 'switch_on_type' is not a recognized lint rule in the included options file.


[warning] 1-1: 'unnecessary_unawaited' is not a recognized lint rule in the included options file.

🔇 Additional comments (5)
pubspec.yaml (1)

10-12: Align Dart SDK constraint
Updated the SDK constraint to ^3.8.0, which aligns with the PR objective and is consistent with other tool and CI configurations.

.github/workflows/tool_linter_rules.yaml (1)

17-21: Update CI Dart version
The GitHub Actions workflow’s Dart setup step now uses sdk: 3.8.0, matching the root and tool SDK constraints.

tool/linter_rules/pubspec.yaml (1)

6-8: Sync tool SDK environment
The linter_rules tool’s pubspec.yaml now specifies sdk: ^3.8.0, maintaining consistency across the repo.

lib/analysis_options.yaml (1)

1-2: Reference new analysis options
This file now includes analysis_options.9.0.0.yaml (v9.0.0). Pipeline warnings indicate unrecognized rules (e.g., switch_on_type, unnecessary_unawaited). Please verify that the included file defines these rules correctly and that their names match the official lint rule names.

🧰 Tools
🪛 GitHub Actions: ci

[warning] 1-1: 'switch_on_type' is not a recognized lint rule in the included options file.


[warning] 1-1: 'unnecessary_unawaited' is not a recognized lint rule in the included options file.

lib/analysis_options.9.0.0.yaml (1)

197-197:

❌ Incorrect review comment

Unrecognized lint rule: unnecessary_unawaited
The analyzer flags unnecessary_unawaited as invalid—consider replacing it with the correct rule (unawaited_futures?) or removing it to clear CI errors.


To verify whether unnecessary_unawaited is actually defined in your analysis options file, let’s inspect the rules around line 197:


🏁 Script executed:

#!/usr/bin/env bash
# Locate the analysis options file
file=$(fd -t f analysis_options.9.0.0.yaml | head -n 1)
echo "Inspecting: $file"
# Show context around the reported line
sed -n '180,220p' "$file"

Length of output: 1540


🌐 Web query:

Is 'unnecessary_unawaited' a valid Dart lint rule?

💡 Result:

Yes, unnecessary_unawaited is a valid Dart lint rule.

This rule flags unnecessary uses of the unawaited() function when calling an asynchronous method or function that is annotated with @awaitNotRequired. When such a method is annotated this way, wrapping it with unawaited() is redundant and should be avoided.

Example from official documentation:

  • BAD:

    @awaitNotRequired
    Future<LogMessage> log(String message) { ... }
    
    void f() {
      unawaited(log('Message.'));
    }
  • GOOD:

    @awaitNotRequired
    Future<LogMessage> log(String message) { ... }
    
    void f() {
      log('Message.');
    }

How to enable:

To enable this rule, add it to your analysis_options.yaml file under linter > rules:

linter:
  rules:
    - unnecessary_unawaited

or using map syntax:

linter:
  rules:
    unnecessary_unawaited: true

The official documentation confirms that unnecessary_unawaited is available in Dart as of version 3.8.0 and provides clear guidelines on its use and configuration[7].

Citations:


Incorrect lint rule warning – unnecessary_unawaited is valid
The rule unnecessary_unawaited has been part of the Dart linter since version 3.8.0 and is correctly listed in your analysis_options.yaml. The CI errors you’re seeing are likely due to an older SDK or linter package that doesn’t yet include this rule. No change is needed in your rules list—please upgrade your Dart analyzer/linter in CI to a version that supports unnecessary_unawaited.

Likely an incorrect or invalid review comment.

@alestiago
Copy link
Contributor

Assigning to @marcossevilla, he will ensure the pipeline passes.

@marcossevilla
Copy link
Member

marcossevilla commented Jun 3, 2025

@alestiago @wolfenrain CI fails because the lints switch_on_type and unnecessary_unawaited are included until Dart 3.8.1, do we want to remove these rules from this analysis options file or update to 3.8.1 to include them?

@alestiago
Copy link
Contributor

Let's exclude those (switch_on_type and unnecessary_unawaited, if not available in Dart 3.8) and update the exclusion reason accordingly. Once we prepare for another release that supports Dart 3.8 or above we would make sure to include them in.

@spydon
Copy link

spydon commented Jun 3, 2025

Let's exclude those (switch_on_type and unnecessary_unawaited, if not available in Dart 3.8) and update the exclusion reason accordingly. Once we prepare for another release that supports Dart 3.8 or above we would make sure to include them in.

I thought this PR was for Dart 3.8? That's the impression I get from the PR description at least. The trailing commas setting isn't supported pre 3.8 either.
Edit: I guess you meant to write 3.8.1?

@marcossevilla
Copy link
Member

I thought this PR was for Dart 3.8? That's the impression I get from the PR description at least. The trailing commas setting isn't supported pre 3.8 either. Edit: I guess you meant to write 3.8.1?

not sure since @wolfenrain created this, but based on what you just shared it makes more sense to me if we use 3.8.1, but we would skip 3.8.0 since we're on 3.7.0 right now. @alestiago do you have more context on this?

@spydon
Copy link

spydon commented Jun 3, 2025

@marcossevilla I have more context. :)
We wanted to get out a new version supporting ^3.8.0 as soon as possible so that people that have skipped 3.7.0 (since it wasn't included in a Flutter release, or actively to avoid the formatter to remove trailing commas) doesn't get their trailing commas removed when formatting after upgrading the SDK. I agree that the min SDK could just as well be bumped to 3.8.1.

@marcossevilla
Copy link
Member

marcossevilla commented Jun 3, 2025

based on what @spydon said, @alestiago and I decided to bump the min sdk to 3.8.0 and add the formatter change since it was available in this version, this release will be 9.0.0.

After this is published, we will work on a 10.0.0-rc.1 so the min sdk is bumped to 3.8.1 and we add the rules that previously conflicted in this same PR.

marcossevilla
marcossevilla previously approved these changes Jun 3, 2025
@marcossevilla marcossevilla changed the title feat: update VGA for Dart v3.8.0 feat: add analysis options 8.1.0 and bump Dart to 3.8.0 Jun 4, 2025
@alestiago alestiago changed the title feat: add analysis options 8.1.0 and bump Dart to 3.8.0 feat: support Dart 3.8.0 Jun 4, 2025
@alestiago alestiago merged commit 93f7149 into main Jun 4, 2025
4 checks passed
@alestiago alestiago deleted the feat/update-vga-for-dart-v3.8.0 branch June 4, 2025 10:09
@marcossevilla marcossevilla mentioned this pull request Jun 4, 2025
2 tasks
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.

4 participants