fix(ci): upgrade analyzer to unblock analysis on current Dart - #15
Merged
Merged
Conversation
The analyzer constraint (>=5.12.0, capped below 7.0.0 by source_gen 1.x) resolved to analyzer 6.4.1 on current Dart SDKs, where `DartType.getDisplayString` still requires `withNullability`. Newer 6.x releases depend on `macros`, which no longer ships with the SDK, so the only way forward is analyzer 7+. Upgrade shape_generator to analyzer 10.x / build 4.x / source_gen 4.x and migrate to the new element model: - Read constructors, fields, methods and type parameters directly off `ClassElement` instead of a `SimpleElementVisitor` - `parameters` -> `formalParameters`, `ParameterElement` -> `FormalParameterElement`, `isSynthetic` -> `isOriginImplicitDefault` - Resolve constructor AST nodes via `firstFragment` - Treat `new` and `null` as unnamed constructor names Also: - Remove `package_api_docs`, a lint removed in Dart 3.7.0 - Bump equatable to ^2.1.0 so `Equatable` can replace the deprecated `EquatableMixin` - Regenerate the generator golden, which dart_style 3.x reformats - Record pana scores for shape and shape_starter_kit, which otherwise default to requiring a perfect score Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ClaireDavis
reviewed
Sep 3, 2026
| analyzer: ">=5.12.0" | ||
| build: ^2.4.1 | ||
| equatable: ^2.0.2 | ||
| analyzer: '>=10.0.0 <11.0.0' |
There was a problem hiding this comment.
I think we need to bump Dart >=3.9, in order for this to be compatible
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Status
READY
Breaking Changes
NO
Description
CI has never actually run green on
main.ci.ymlwas added by #11, and that PR's own checks ran the old per-package workflow files it deleted — so the new pipeline's first real execution was on a later PR, by which point it was already broken. This unblocks it.Four independent failures, all pre-existing:
1.
dart analyzefails with 7 errors ongetDisplayString. Theanalyzer: ">=5.12.0"constraint was capped below7.0.0bysource_gen 1.x, so it resolved to analyzer 6.4.1, whereDartType.getDisplayStringstill requireswithNullability. Newer 6.x releases aren't an option either — they depend onmacros, which no longer ships with the Dart SDK. Analyzer 7+ is the only way forward.This upgrades
shape_generatorto analyzer 10.x / build 4.x / source_gen 4.x and migrates to the new element model:ClassElementinstead of aSimpleElementVisitorparameters→formalParameters,ParameterElement→FormalParameterElement,isSynthetic→isOriginImplicitDefaultfirstFragmentnewandnullas unnamed constructor names, which is how the new model reports them2.
package_api_docswas removed in Dart 3.7.0 and now trips--fatal-warnings. Removed fromanalysis_options.yaml.3.
EquatableMixinis deprecated and trips--fatal-infos. Bumpedequatableto^2.1.0, whereEquatableitself can be used as a mixin.4.
check_panawould newly fail forshapeandshape_starter_kitoncebuildgoes green. Neither has aPANA_SCOREfile, andverify_pub_score.shsilently falls back to demanding a perfect 160 when the score argument is empty. Recorded their actual scores (135 and 145) the wayshape_generatoralready does.The generator golden is also regenerated — dart_style 3.x reformats the output.
Relationship to other PRs
The analyzer work is a subset of #12, ported to keep this reviewable: #12 also reworks the
shape/shape_generatorAPIs for v0.1.0, and none of that is here. Where #12's version of a change was entangled with that rework, this takes the smaller path instead — #12 deletesequatableoutright and generates==/hashCode, for example, where this just bumps the constraint.Split out of #14 so that PR stays a one-file workflow change. #14 is red until this lands.
Type of Change
🤖 Generated with Claude Code