Skip to content

Upgrade to analyzer ^14.0.0 - #98

Merged
btr-rmconsole-5[bot] merged 5 commits into
masterfrom
analyzer_14
Sep 23, 2026
Merged

btr-rmconsole-5[bot] merged 5 commits into
masterfrom
analyzer_14

Conversation

@robbecker-wf

Copy link
Copy Markdown
Member

Motivation

Consumers on newer toolchains need codemod to work with analyzer 14. The current constraint (>=5.13.0 <11.0.0) blocks that.

Changes

  • Require analyzer: ^14.0.0. Analyzer 14 requires Dart ^3.11.0, so the SDK constraint is raised to match.
  • FileContext.getUnresolvedUnit: use diagnosticCode.lowerCaseName instead of the deprecated errorCode.name when building parse-error messages. Error codes now print in lower case (e.g. expected_token).
  • Tests: LibraryIdentifier was removed in analyzer 12, so the LibNameDoubler test visitor now uses visitDottedName / DottedName.tokens.
  • README / docs: add a Requirements section, replace the nonexistent package:analyzer/analyzer.dart import in examples, correct the runInteractiveCodemod signature, and import package:codemod/test.dart in the testing examples.
  • CHANGELOG: add an Unreleased breaking-change entry.

This is a breaking change for consumers on analyzer < 14 or Dart < 3.11.

Release Notes

Require analyzer ^14.0.0 and Dart SDK ^3.11.0.

Review

See CONTRIBUTING.md for more details on review types and code review process.

Please review:

QA Checklist

  • Tests were updated and provide good coverage of the changeset and other affected code
  • Manual testing was performed if needed
    • Steps from PR author: dart analyze (no new issues) and dart test (all 75 pass) on Dart 3.13.4 with analyzer 14.4.0
    • Anything falling under manual testing criteria outlined in CONTRIBUTING.md

Merge Checklist

While we perform many automated checks before auto-merging, some manual checks are needed:

  • A Frontend Frameworks Architecture member has reviewed these changes
  • There are no unaddressed comments - this check can be automated if reviewers use the "Request Changes" feature
  • For release PRs - Version metadata in Rosie comment is correct

- Require analyzer ^14.0.0 and Dart SDK ^3.11.0
- Use diagnosticCode.lowerCaseName instead of deprecated errorCode.name
- Replace removed LibraryIdentifier with DottedName in tests
- Fix outdated analyzer imports and examples in README and docs

Co-authored-by: Cursor <cursoragent@cursor.com>
robbecker-wf and others added 3 commits September 23, 2026 11:46
- Await the codemod future inside try so async errors are caught and
  reported with ExitCode.software instead of escaping uncaught
- Remove invalid @OverRide annotations on top-level functions
- Format file_context.dart

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
uses: Workiva/gha-dart-oss/.github/workflows/checks.yaml@v0.1.14
with:
sdk: 3.13.4
format-check: false

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

will follow up with a format-all-the-code PR

return ExitCode.success.code;
}
return overrideAnsiOutput<Future<int>>(
return await overrideAnsiOutput<Future<int>>(

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

had to fix analyzer warnings since it was failing now under newer dart

yield FooPatch();
}

@override

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

more analyzer warnings

@robbecker-wf
robbecker-wf marked this pull request as ready for review September 23, 2026 18:26
Comment thread README.md
Comment on lines -24 to +34
Future<int> runInteractiveCodemod(Iterable<File> files, Suggestor suggestor);
Future<int> runInteractiveCodemod(Iterable<String> filePaths, Suggestor suggestor);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note to self - this is just aligning the docs with the code; no breaking change was made in this PR.

@robbecker-wf

Copy link
Copy Markdown
Member Author

QA +1 CI passes @Workiva/release-management-p

@rmconsole-wf rmconsole-wf left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

+1 from RM

@btr-rmconsole-5
btr-rmconsole-5 Bot merged commit 9e9eadd into master Sep 23, 2026
13 checks passed
@btr-rmconsole-5
btr-rmconsole-5 Bot deleted the analyzer_14 branch September 23, 2026 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants