Use Dart 3.8.0, analyzer 7.5.9, reformat.#1277
Use Dart 3.8.0, analyzer 7.5.9, reformat.#1277rrousselGit merged 1 commit intorrousselGit:masterfrom
Conversation
WalkthroughThis update raises the minimum Dart SDK to 3.8.0 and the analyzer version to 7.5.9, updates CI workflows to use the Flutter stable channel, and applies extensive code and test formatting improvements across the Freezed package. No logic, control flow, or public API changes are introduced; all modifications are stylistic or configuration-related. Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant CI Workflow
participant Flutter SDK
Developer->>CI Workflow: Push code / PR
CI Workflow->>Flutter SDK: Setup using "stable" channel
CI Workflow-->>Developer: Run checks, formatting, and tests on stable channel
Possibly related PRs
Suggested reviewers
Poem
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (9)
.github/workflows/build.yml (1)
55-56: Nit: tighten the comment wordingMinor wording tweak for clarity.
-# Check dart format only on stable +# Run `dart format` only when testing the stable channelpackages/freezed/CHANGELOG.md (1)
1-2: Bullet is misplaced and contains a typoThe new entry sits outside any release section and “minumum” is miss-spelled.
Move it under## 3.1.0and fix the spelling.- Support Dart 3.8.0 and analyzer 7.5.9 as a minumum. +### Dart/Analyzer +* Support Dart 3.8.0 and analyzer 7.5.9 as a minimum.packages/freezed/test/multiple_constructors_test.dart (1)
179-184: Remove redundant cast toErrorsResult
AnalysisSession.getErrorsalready returnsFuture<ErrorsResult>. The extraas ErrorsResultadds noise without benefit.- final errorResult = - await main.session.getErrors( - '/freezed/test/integration/multiple_constructors.freezed.dart', - ) - as ErrorsResult; + final errorResult = await main.session.getErrors( + '/freezed/test/integration/multiple_constructors.freezed.dart', + );packages/freezed/test/map_test.dart (1)
302-305: Same redundant cast hereAs in the previous test file, the cast to
ErrorsResultis unnecessary.- final errorResult = - await main!.session.getErrors('/freezed/test/integration/main.dart') - as ErrorsResult; + final errorResult = + await main!.session.getErrors('/freezed/test/integration/main.dart');packages/freezed/lib/src/templates/pattern_template.dart (1)
296-298: Add space after commas for generated readabilityWhen the generated union has multiple properties,
join(',')produces"a,b"– dart-format will fix it later, but emitting"a, b"up-front is cleaner and avoids extra formatter churn.- .map((e) => '_that.${e.name}') - .join(','); + .map((e) => '_that.${e.name}') + .join(', ');packages/freezed/lib/src/templates/parameter_template.dart (1)
258-269: Clarify field access incopyWithUsing
this.typeDisplayString/this.parameterElementmakes it explicit that the original field value is retained and avoids the slight cognitive overhead of shadow-lookup.- type: type ?? this.type, - typeDisplayString: typeDisplayString, + type: type ?? this.type, + typeDisplayString: this.typeDisplayString, ... - parameterElement: parameterElement, + parameterElement: this.parameterElement,packages/freezed/lib/src/templates/copy_with.dart (2)
90-94: Redundant newline inside doc string (minor)The triple-quoted string already starts with a newline, so the extra leading blank line after
${_copyWithDocs(...)}results in an empty line in the generated comment. Totally harmless, but you may want to drop it to avoid stray blank lines in emitted code.
221-225: Add a space after commas for readabilityThe parameters list is concatenated with
','.join(...), which producesa,intinstead ofa, int. It compiles, but a single space after commas matches the surrounding style and aids readability of the generated code.- .join(','); + .join(', ');packages/freezed/lib/src/templates/concrete_template.dart (1)
528-529: Minor readability suggestion
needsConstModifiercondition is untouched functionally, but chaining with leading!reads slightly better if grouped:- var needsConstModifier = - !declaration.type.isDartCoreString && + var needsConstModifier = !declaration.type.isDartCoreString &&Purely cosmetic—ignore if you prefer current wrapping.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (40)
.github/workflows/build.yml(3 hunks)packages/freezed/CHANGELOG.md(1 hunks)packages/freezed/example/lib/main.dart(2 hunks)packages/freezed/example/lib/time_slot.dart(1 hunks)packages/freezed/example/test/diagnosticable_test.dart(1 hunks)packages/freezed/example/test/json_test.dart(1 hunks)packages/freezed/lib/src/ast.dart(3 hunks)packages/freezed/lib/src/freezed_generator.dart(2 hunks)packages/freezed/lib/src/models.dart(10 hunks)packages/freezed/lib/src/string.dart(1 hunks)packages/freezed/lib/src/templates/abstract_template.dart(2 hunks)packages/freezed/lib/src/templates/concrete_template.dart(5 hunks)packages/freezed/lib/src/templates/copy_with.dart(4 hunks)packages/freezed/lib/src/templates/from_json_template.dart(2 hunks)packages/freezed/lib/src/templates/parameter_template.dart(7 hunks)packages/freezed/lib/src/templates/pattern_template.dart(8 hunks)packages/freezed/lib/src/templates/properties.dart(2 hunks)packages/freezed/lib/src/tools/recursive_import_locator.dart(3 hunks)packages/freezed/lib/src/tools/type.dart(1 hunks)packages/freezed/pubspec.yaml(1 hunks)packages/freezed/test/bidirectional_test.dart(1 hunks)packages/freezed/test/common.dart(1 hunks)packages/freezed/test/common_types_test.dart(1 hunks)packages/freezed/test/decorator_test.dart(4 hunks)packages/freezed/test/deep_copy_test.dart(4 hunks)packages/freezed/test/generic_test.dart(2 hunks)packages/freezed/test/generics_refs_test.dart(1 hunks)packages/freezed/test/integration/json.dart(9 hunks)packages/freezed/test/integration/multiple_constructors.dart(1 hunks)packages/freezed/test/integration/single_class_constructor.dart(3 hunks)packages/freezed/test/json_test.dart(1 hunks)packages/freezed/test/manual_test.dart(2 hunks)packages/freezed/test/map_test.dart(24 hunks)packages/freezed/test/multiple_constructors_test.dart(7 hunks)packages/freezed/test/optional_maybe_test.dart(5 hunks)packages/freezed/test/single_class_constructor_test.dart(7 hunks)packages/freezed/test/source_gen_src.dart(1 hunks)packages/freezed/test/source_gen_test.dart(1 hunks)packages/freezed/test/typedef_parameter_test.dart(1 hunks)packages/freezed/test/when_test.dart(23 hunks)
🧰 Additional context used
🧠 Learnings (19)
📓 Common learnings
Learnt from: lishaduck
PR: rrousselGit/freezed#1147
File: packages/freezed_lint/pubspec.yaml:12-12
Timestamp: 2025-01-07T20:51:22.701Z
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.
Learnt from: lishaduck
PR: rrousselGit/freezed#1147
File: packages/freezed_lint/pubspec.yaml:12-12
Timestamp: 2025-01-07T20:51:22.701Z
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.
packages/freezed/CHANGELOG.md (2)
Learnt from: lishaduck
PR: rrousselGit/freezed#1147
File: packages/freezed_lint/pubspec.yaml:12-12
Timestamp: 2025-01-07T20:51:22.701Z
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.
Learnt from: lishaduck
PR: rrousselGit/freezed#1147
File: packages/freezed_lint/pubspec.yaml:12-12
Timestamp: 2025-01-07T20:51:22.701Z
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.
.github/workflows/build.yml (2)
Learnt from: lishaduck
PR: rrousselGit/freezed#1147
File: packages/freezed_lint/pubspec.yaml:12-12
Timestamp: 2025-01-07T20:51:22.701Z
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.701Z
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.
packages/freezed/lib/src/tools/recursive_import_locator.dart (2)
Learnt from: lishaduck
PR: rrousselGit/freezed#1147
File: packages/freezed_lint/pubspec.yaml:12-12
Timestamp: 2025-01-07T20:51:22.701Z
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.
Learnt from: lishaduck
PR: rrousselGit/freezed#1147
File: packages/freezed_lint/pubspec.yaml:12-12
Timestamp: 2025-01-07T20:51:22.701Z
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.
packages/freezed/pubspec.yaml (2)
Learnt from: lishaduck
PR: rrousselGit/freezed#1147
File: packages/freezed_lint/pubspec.yaml:12-12
Timestamp: 2025-01-07T20:51:22.701Z
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.
Learnt from: lishaduck
PR: rrousselGit/freezed#1147
File: packages/freezed_lint/pubspec.yaml:12-12
Timestamp: 2025-01-07T20:51:22.701Z
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.
packages/freezed/test/integration/json.dart (1)
Learnt from: lishaduck
PR: rrousselGit/freezed#1147
File: packages/freezed_lint/pubspec.yaml:12-12
Timestamp: 2025-01-07T20:51:22.701Z
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.
packages/freezed/test/single_class_constructor_test.dart (2)
Learnt from: lishaduck
PR: rrousselGit/freezed#1147
File: packages/freezed_lint/pubspec.yaml:12-12
Timestamp: 2025-01-07T20:51:22.701Z
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.
Learnt from: lishaduck
PR: rrousselGit/freezed#1147
File: packages/freezed_lint/pubspec.yaml:12-12
Timestamp: 2025-01-07T20:51:22.701Z
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.
packages/freezed/test/when_test.dart (1)
Learnt from: rrousselGit
PR: rrousselGit/freezed#1157
File: packages/freezed/test/integration/extend.dart:10-14
Timestamp: 2025-02-23T20:01:34.876Z
Learning: In Dart, when calling a named super constructor, the syntax `super.value` can be used in the constructor parameters along with `super.named()` in the initializer list. For example: `const Subclass._(super.value) : super.named();` is valid syntax to call the named constructor `Base.named()`.
packages/freezed/lib/src/ast.dart (1)
Learnt from: lishaduck
PR: rrousselGit/freezed#1147
File: packages/freezed_lint/pubspec.yaml:12-12
Timestamp: 2025-01-07T20:51:22.701Z
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.
packages/freezed/test/deep_copy_test.dart (1)
Learnt from: lishaduck
PR: rrousselGit/freezed#1147
File: packages/freezed_lint/pubspec.yaml:12-12
Timestamp: 2025-01-07T20:51:22.701Z
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.
packages/freezed/test/generic_test.dart (1)
Learnt from: lishaduck
PR: rrousselGit/freezed#1147
File: packages/freezed_lint/pubspec.yaml:12-12
Timestamp: 2025-01-07T20:51:22.701Z
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.
packages/freezed/test/decorator_test.dart (2)
Learnt from: lishaduck
PR: rrousselGit/freezed#1147
File: packages/freezed_lint/pubspec.yaml:12-12
Timestamp: 2025-01-07T20:51:22.701Z
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.701Z
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.
packages/freezed/lib/src/templates/copy_with.dart (1)
Learnt from: rrousselGit
PR: rrousselGit/freezed#1157
File: packages/freezed/test/integration/extend.dart:10-14
Timestamp: 2025-02-23T20:01:34.876Z
Learning: In Dart, when calling a named super constructor, the syntax `super.value` can be used in the constructor parameters along with `super.named()` in the initializer list. For example: `const Subclass._(super.value) : super.named();` is valid syntax to call the named constructor `Base.named()`.
packages/freezed/lib/src/freezed_generator.dart (1)
Learnt from: lishaduck
PR: rrousselGit/freezed#1147
File: packages/freezed_lint/pubspec.yaml:12-12
Timestamp: 2025-01-07T20:51:22.701Z
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.
packages/freezed/lib/src/templates/parameter_template.dart (1)
Learnt from: rrousselGit
PR: rrousselGit/freezed#1157
File: packages/freezed/test/integration/extend.dart:10-14
Timestamp: 2025-02-23T20:01:34.876Z
Learning: In Dart, when calling a named super constructor, the syntax `super.value` can be used in the constructor parameters along with `super.named()` in the initializer list. For example: `const Subclass._(super.value) : super.named();` is valid syntax to call the named constructor `Base.named()`.
packages/freezed/test/map_test.dart (1)
Learnt from: rrousselGit
PR: rrousselGit/freezed#1157
File: packages/freezed/test/integration/extend.dart:10-14
Timestamp: 2025-02-23T20:01:34.876Z
Learning: In Dart, when calling a named super constructor, the syntax `super.value` can be used in the constructor parameters along with `super.named()` in the initializer list. For example: `const Subclass._(super.value) : super.named();` is valid syntax to call the named constructor `Base.named()`.
packages/freezed/test/manual_test.dart (1)
Learnt from: lishaduck
PR: rrousselGit/freezed#1147
File: packages/freezed_lint/pubspec.yaml:12-12
Timestamp: 2025-01-07T20:51:22.701Z
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.
packages/freezed/test/integration/single_class_constructor.dart (1)
Learnt from: rrousselGit
PR: rrousselGit/freezed#1157
File: packages/freezed/test/integration/extend.dart:10-14
Timestamp: 2025-02-23T20:01:34.876Z
Learning: In Dart, when calling a named super constructor, the syntax `super.value` can be used in the constructor parameters along with `super.named()` in the initializer list. For example: `const Subclass._(super.value) : super.named();` is valid syntax to call the named constructor `Base.named()`.
packages/freezed/lib/src/models.dart (3)
Learnt from: lishaduck
PR: rrousselGit/freezed#1147
File: packages/freezed_lint/pubspec.yaml:12-12
Timestamp: 2025-01-07T20:51:22.701Z
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.
Learnt from: lishaduck
PR: rrousselGit/freezed#1147
File: packages/freezed_lint/pubspec.yaml:12-12
Timestamp: 2025-01-07T20:51:22.701Z
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: rrousselGit
PR: rrousselGit/freezed#1157
File: packages/freezed/test/integration/extend.dart:10-14
Timestamp: 2025-02-23T20:01:34.876Z
Learning: In Dart, when calling a named super constructor, the syntax `super.value` can be used in the constructor parameters along with `super.named()` in the initializer list. For example: `const Subclass._(super.value) : super.named();` is valid syntax to call the named constructor `Base.named()`.
🪛 LanguageTool
packages/freezed/CHANGELOG.md
[grammar] ~1-~1: Ensure spelling is correct
Context: ...port Dart 3.8.0 and analyzer 7.5.9 as a minumum. ## 3.1.0 - 2025-07-02 - Added when/...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🔇 Additional comments (72)
.github/workflows/build.yml (2)
24-33:packages/freezed_lintis completely excluded – confirm this is intentionalWith the matrix now containing only the
stablechannel, the exclusion rules on L29-33 remove every combination that involvespackages/freezed_lint.
As a result, the “Lint golden test” block at L80-87 will never execute andfreezed_lintwon’t be built, analyzed, or tested in CI.If the intent was merely to avoid the custom-lint issue on non-stable channels, you may want to:
- Drop the package exclusion and keep only the
dependencies: downgradeexclusion; or- Split the job or add a conditional so that
packages/freezed_lintstill runs its golden test on thestablechannel.Please double-check that skipping this package is acceptable for the project.
40-40: Caching condition looks good
cache: ${{ matrix.channel == 'stable' }}resolves to the literal strings"true"/"false", which thesubosito/flutter-actioninput correctly interprets as booleans. No action needed.packages/freezed/pubspec.yaml (1)
9-14: Raising the lower SDK bound is a breaking change – consider4.0.0Per pub semver, increasing the minimum Dart SDK (
3.6 → 3.8) is breaking for users pinned to 3.6/3.7.
Publishing as3.1.0may violate versioning expectations.Please confirm whether a major bump (e.g.
4.0.0) is more appropriate, or explicitly justify keeping the minor bump.packages/freezed/test/generics_refs_test.dart (1)
17-21: Readability tweak looks goodThe multi-line formatting improves scan-ability without altering behavior.
packages/freezed/lib/src/string.dart (1)
17-24: No issues – formatting onlyThe refactor is purely cosmetic and keeps the original semantics intact.
packages/freezed/test/integration/multiple_constructors.dart (2)
143-147: Whitespace insertion is harmlessThe blank line increases visual separation inside the parameter list; compilation is unaffected.
151-155: Whitespace insertion is harmlessSame comment as above—purely stylistic.
packages/freezed/test/common_types_test.dart (1)
21-25: Refactor for clarity acknowledgedSplitting the awaited call onto multiple lines aids readability; no functional impact observed.
packages/freezed/lib/src/templates/abstract_template.dart (1)
23-24: Line break improves readabilityThe logical expression is now easier to read. ✅
packages/freezed/lib/src/templates/properties.dart (2)
26-36: LGTM: Improved constructor formatting.The reformatting of the
fromParameterconstructor call enhances readability by making the parameter passing more compact and consistent.
84-89: LGTM: Consistent method return formatting.The reformatting of the
abstractGetter,asGetter, andabstractSettermethods creates consistent, readable parameter passing patterns across all three methods.Also applies to: 92-97, 100-105
packages/freezed/test/source_gen_test.dart (1)
43-49: LGTM: Improved test assertion formatting.The reformatting of the
expectstatement makes the substring operation more readable and maintains proper line alignment.packages/freezed/test/source_gen_src.dart (1)
16-16: LGTM: Constructor formatting simplified.The conversion to a single-line constructor maintains the same functionality while improving conciseness.
packages/freezed/lib/src/ast.dart (2)
9-13: LGTM: Improved for loop formatting.The multi-line formatting of the for loop enhances readability by clearly separating the initialization, condition, and increment parts.
68-70: LGTM: Consistent method chain formatting.The reformatting of the method chains for
genericsvariable assignment creates consistent, readable patterns in both thefullNameandescapedNamemethods.Also applies to: 85-87
packages/freezed/lib/src/tools/type.dart (1)
46-50: LGTM: Simplified lambda expressions.The conversion to implicit returns in the nested lambda expressions improves code conciseness while maintaining the same functionality.
packages/freezed/lib/src/tools/recursive_import_locator.dart (3)
35-41: LGTM: Improved formatting of chained method callsThe reformatting improves readability by consistently aligning the chained method calls with proper indentation.
50-60: LGTM: Better indentation for method parameters and boolean expressionsThe indentation adjustments enhance code readability while maintaining the same logic.
164-167: LGTM: Consistent parameter formattingThe parameter alignment in the
Object.hashcall is more readable and follows consistent formatting conventions.packages/freezed/test/deep_copy_test.dart (3)
27-31: LGTM: Improved formatting of async method callsThe reformatting makes the async
getErrorscall more readable by properly separating the method and its arguments.
44-48: LGTM: Consistent formatting with other test methodsThe formatting matches the pattern used in other test methods, maintaining consistency across the test file.
712-732: LGTM: Better organization of complex method callsThe formatting improvements make the complex
resolveSourcescall and subsequentgetErrorscall more readable.packages/freezed/test/integration/single_class_constructor.dart (3)
15-15: LGTM: Consolidated factory constructor parameterThe single-line formatting is more concise and appropriate for this simple factory constructor parameter.
306-306: LGTM: Added visual separationThe blank line improves visual separation between the positional and named parameters in the factory constructor.
535-536: LGTM: Consolidated comment and annotationThe formatting consolidation maintains readability while being more concise.
packages/freezed/lib/src/models.dart (7)
119-121: LGTM: Improved type arguments formattingThe formatting makes the type arguments mapping more readable with proper indentation.
153-154: LGTM: Better error message formattingThe multi-line error message is more readable with proper indentation.
279-283: LGTM: Consistent variable assignment formattingThe formatting improves readability of the complex variable assignment with proper line breaks.
530-531: LGTM: Constructor formatting improvementThe constructor parameters are properly aligned and the assertion is clearly separated.
780-792: LGTM: Complex type map formattingThe formatting of the complex type map declaration significantly improves readability with proper indentation and line breaks.
967-971: LGTM: Method call formattingThe
leastUpperBoundmethod call is more readable with proper parameter alignment.
1089-1091: LGTM: Generics parameter template formattingThe formatting of the generics parameter template is cleaner and more readable.
packages/freezed/example/test/diagnosticable_test.dart (1)
12-12: LGTM: Consolidated expect statementThe single-line formatting is more concise and appropriate for this simple test assertion.
packages/freezed/test/bidirectional_test.dart (1)
16-20: LGTM: Formatting improvement enhances readability.The multi-line formatting of the async call and cast improves code readability without changing functionality.
packages/freezed/example/lib/time_slot.dart (1)
10-10: LGTM: Concise factory constructor formatting.The single-line formatting of the factory constructor improves code conciseness while maintaining all functionality.
packages/freezed/test/typedef_parameter_test.dart (1)
17-21: LGTM: Consistent formatting improvement.The multi-line formatting matches the pattern used in other test files and enhances readability without changing functionality.
packages/freezed/test/manual_test.dart (2)
24-24: LGTM: Improved constructor initializer formatting.The indentation improvement enhances code readability while preserving functionality.
112-114: LGTM: Enhanced test case readability.The multi-line formatting of the constructor call improves test readability without changing test logic.
packages/freezed/example/test/json_test.dart (2)
6-13: LGTM: Concise test assertion formatting.The inline map literals make the test assertions more concise and readable while preserving all test logic.
18-18: LGTM: Consistent inline formatting.The inline map literal formatting matches the style used in other test assertions in this file.
packages/freezed/test/json_test.dart (1)
750-754: LGTM! Improved readability through multi-line formatting.The reformatting of the
errorResultassignment enhances readability by breaking down the complex awaited call and cast into properly indented lines.packages/freezed/test/common.dart (2)
10-21: LGTM! Improved formatting for better readability.The multi-line reformatting of the
resolveSourcescall enhances code readability through consistent indentation and parameter alignment.
23-25: LGTM! Consistent formatting with improved readability.The multi-line formatting of the
errorResultassignment matches the pattern used in other test files and improves code clarity.packages/freezed/test/single_class_constructor_test.dart (1)
30-39: LGTM! Consistent formatting improvements throughout the file.The reformatting enhances code readability through:
- Multi-line formatting for complex function calls
- Consistent indentation and alignment
- Better visual structure for object instantiations and method calls
All changes are purely stylistic with no functional impact.
Also applies to: 214-216, 251-254, 258-261, 266-269, 276-279, 378-382, 393-395, 635-649, 651-653
packages/freezed/test/integration/json.dart (1)
347-347: LGTM! Consistent formatting for factory constructors.The reformatting of
fromJsonfactory constructors to single-line expressions improves consistency and readability while maintaining identical functionality.Also applies to: 382-382, 397-397, 412-412, 427-427, 443-443, 571-571, 584-584, 617-621
packages/freezed/test/generic_test.dart (1)
48-52: LGTM! Formatting improvements for better readability.The multi-line reformatting of complex expressions and consistent parameter alignment enhance code readability while maintaining identical functionality.
Also applies to: 67-70, 74-76
packages/freezed/test/decorator_test.dart (5)
15-23: LGTM: Improved formatting for async error retrieval calls.The reformatting of
await main.session.getErrorscalls with multi-line indentation enhances readability while maintaining identical functionality.
30-39: LGTM: Enhanced readability for resolveSources call.The multi-line formatting with proper indentation and trailing commas improves code clarity without affecting test behavior.
50-52: LGTM: Improved formatting for chained method calls.The multi-line formatting of the chained method calls enhances readability while preserving the same functionality.
61-87: LGTM: Consistent formatting improvements for resolveSources.The multi-line formatting with proper indentation and parameter alignment improves code readability without altering test logic.
89-91: LGTM: Consistent formatting for error retrieval.The multi-line formatting aligns with the established pattern and improves readability.
packages/freezed/example/lib/main.dart (4)
24-27: LGTM: Cleaner factory constructor formatting.The reformatting of the factory constructor parameters improves readability while maintaining the same functionality.
54-58: LGTM: Improved switch expression formatting.The multi-line formatting with proper indentation enhances readability of the switch expression.
64-75: LGTM: Consistent switch expression formatting.The multi-line formatting provides better readability and maintains consistency with other switch expressions in the file.
82-84: LGTM: Enhanced print statement formatting.The multi-line formatting improves readability for complex print statements.
packages/freezed/test/when_test.dart (4)
34-49: LGTM: Improved formatting for expectLater calls.The multi-line formatting with explicit parentheses and indentation enhances readability of the test assertions while maintaining identical functionality.
286-299: LGTM: Enhanced resolveSources formatting.The multi-line formatting with proper indentation improves code clarity without affecting test behavior.
301-303: LGTM: Consistent async error retrieval formatting.The multi-line formatting aligns with the established pattern and improves readability.
411-413: LGTM: Improved method call formatting.The multi-line formatting enhances readability while preserving the same functionality.
packages/freezed/lib/src/freezed_generator.dart (2)
43-46: LGTM: Improved formatting for nullable property assignment.The multi-line formatting enhances readability of the complex boolean expression while maintaining identical functionality.
119-128: LGTM: Enhanced formatting for copyWith assignment.The multi-line formatting with proper indentation improves readability of the complex conditional expression and method chaining.
packages/freezed/test/optional_maybe_test.dart (4)
11-14: LGTM: Cleaner map syntax and improved lambda formatting.The removal of braces around the single-entry map and the multi-line formatting of the lambda expression enhance readability.
17-21: LGTM: Enhanced async error retrieval formatting.The multi-line formatting with proper indentation improves readability while maintaining identical functionality.
27-43: LGTM: Improved expectLater formatting.The multi-line formatting with explicit parentheses and indentation enhances readability of the test assertions.
97-98: LGTM: Consistent formatting for expect statements.The formatting improvements enhance readability while preserving the same test behavior.
packages/freezed/lib/src/templates/copy_with.dart (2)
65-71: No functional change – looks goodThis hunk is a pure re-indent of the multi-line literal assigned to
body; the generated output remains byte-for-byte identical.
No action required.
249-253: LGTMPure re-indent; logic unchanged.
packages/freezed/lib/src/templates/concrete_template.dart (4)
31-34: Style-only change acknowledgedJust splits a long boolean expression across multiple lines; behaviour unchanged.
141-146: No observable behavioural change – safe re-format.
233-284: Guard clauses remain intact – implementation still correctVerified that the unmodifiable-collection wrappers and nullability checks are preserved exactly; only whitespace/indentation changed.
303-310: Trivial re-indent; nothing to add.packages/freezed/lib/src/templates/from_json_template.dart (1)
35-40: Formatting-only change looks correctIndentation and triple-quoted string placement align with the rest of the template code and do not alter the generated output. No action needed.
| analyzer: ">=7.5.9 <8.0.0" | ||
| build: ^2.5.0 |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Double-check downstream custom_lint / freezed_lint compatibility
analyzer >= 7.5.9 can still collide with custom_lint < 0.6, which is currently pinned below 7.x (see invertase/dart_custom_lint#300).
Consider documenting this in the README or guarding with explanatory release notes to prevent solver conflicts for users consuming both freezed and freezed_lint.
🤖 Prompt for AI Agents
In packages/freezed/pubspec.yaml around lines 13 to 14, the analyzer version
constraint ">=7.5.9 <8.0.0" may cause compatibility issues with custom_lint
versions below 0.6, which are pinned below analyzer 7.x. To fix this, add a note
in the README or release notes explaining this potential conflict and advising
users about the version constraints when using both freezed and freezed_lint
together, helping prevent dependency solver conflicts.
| if (globalData.hasDiagnostics && data.options.asString) | ||
| 'DiagnosticableTreeMixin' | ||
| 'DiagnosticableTreeMixin', | ||
| ].join(); |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Use a separator in join to avoid future string concatenation bugs
If additional interfaces are appended later, the current join() (empty separator) will concatenate names without commas or spaces ('FooBar'). Safer to specify ', '.
- var interfaces = [
- if (globalData.hasDiagnostics && data.options.asString)
- 'DiagnosticableTreeMixin',
- ].join();
+ var interfaces = [
+ if (globalData.hasDiagnostics && data.options.asString)
+ 'DiagnosticableTreeMixin',
+ ].join(', ');📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if (globalData.hasDiagnostics && data.options.asString) | |
| 'DiagnosticableTreeMixin' | |
| 'DiagnosticableTreeMixin', | |
| ].join(); | |
| var interfaces = [ | |
| if (globalData.hasDiagnostics && data.options.asString) | |
| 'DiagnosticableTreeMixin', | |
| ].join(', '); |
🤖 Prompt for AI Agents
In packages/freezed/lib/src/templates/abstract_template.dart around lines 38 to
40, the join method is called without a separator, which concatenates interface
names directly and can cause issues if more interfaces are added later. Fix this
by specifying a separator string like ', ' in the join call to ensure interface
names are properly separated.
|
Thanks for this :) |
Flutter channel name has changed from
mastertomain, change it tomainto get the latest Flutter which has 3.8.0.But, this hits an issue in custom_lint, so use
stablefor now.Using Dart 3.8.0 triggers a formatting change: reformat.
Summary by CodeRabbit
Chores
Style
Documentation