update-dart-lints Skill
This skill automates the process of updating pedantic_mono to support the latest Dart/Flutter release, updating linter rules in lib/analysis_options.yaml, logging updates in CHANGELOG.md, and triggering the release-pub skill to publish a new release.
Reference Links
- Dart Changelog: https://dart.dev/changelog
- Dart SDK GitHub Changelog: https://github.com/dart-lang/sdk/blob/main/CHANGELOG.md
Workflow Steps
Follow these steps sequentially to perform a lint update and release:
1. Information Gathering & Diff Analysis
Check Official Changelogs:
- Read https://raw.githubusercontent.com/dart-lang/sdk/main/CHANGELOG.md or https://dart.dev/changelog thoroughly.
- Search specifically for the
Tools -> LinterandTools -> Analyzersections of the target release to capture ALL newly added, modified, or deprecated lints. - Note:
- The latest stable Dart version number (e.g.,
3.13.0). - ALL new linter rules added in this release.
- Deprecated or removed linter rules.
- The latest stable Dart version number (e.g.,
Run Linter Diff Tool:
- Run the local grinder task to check diffs and duplicate rules against
flutter_lints,recommended, andcore:dart run tool/grind.dart diff - Analyze the output to see:
- Rules unique to
pedantic_mono. - Rules introduced in
flutter_lints. - Duplicated rules between
pedantic_monoandflutter_lints.
- Rules unique to
- Run the local grinder task to check diffs and duplicate rules against
2. Rule Impact Evaluation & User Review (MANDATORY)
Do NOT automatically enable all newly discovered linter rules without evaluation. You must evaluate each new rule for potential drawbacks and consult the user before editing lib/analysis_options.yaml:
Analyze Impact & Drawbacks:
- Experimental Rules: Identify if a rule is marked as experimental (e.g.,
use_primary_constructors). Experimental rules often introduce excessive noise or unexpected warnings. - Strict Mode Rules: Identify if a rule duplicates analyzer options (e.g.,
no_dynamic_castsvsstrict-casts: true) or creates excessive friction in day-to-day coding. - Style & DX Impact: Assess if a rule forces rigid code style changes (e.g.,
empty_container_bodies,use_declaring_parameters) or creates friction with interface implementations (e.g.,async_return_with_no_await).
- Experimental Rules: Identify if a rule is marked as experimental (e.g.,
Present Table & Consult User:
- Present a clear evaluation table for the user showing each candidate rule, its purpose, impact level (High / Medium / Low / Experimental), and potential drawbacks.
- Ask the user which rules to enable, omit, or keep commented out.
- Wait for explicit user approval on the selected set of rules before updating
lib/analysis_options.yaml.
3. Update Configurations & Code
Update
pubspec.yaml:- Update
environment.sdkto the new minimum Dart version (e.g.,^3.13.0):environment: sdk: ^3.13.0
- Update
Update
lib/analysis_options.yaml:- Add new lints: Add new linter rules under
linter.rulesin alphabetical order. - Remove duplicates: Comment out or remove rules that are already included in
flutter_lints. - Remove deprecated/deleted lints: Comment out or remove rules that have been removed or deprecated in the new Dart version.
- Add new lints: Add new linter rules under
Verify Code Quality:
- Run static analysis:
Ensure all errors, warnings, and info-level lints are resolved.dart analyze - Run tests:
Ensure all tests pass.dart test
- Run static analysis:
4. Update CHANGELOG.md
Add a new version entry at the top of CHANGELOG.md following pedantic_mono's conventions:
- Use a minor version bump for new Dart version support / added lints (e.g.,
## 1.38.0). - Format entries as follows (always include links to
https://dart.dev/tools/linter-rules/<lint_name>for linter rules):## 1.38.0 - Change minimum Dart version to ^3.13 🎯 - Add [`initialize_in_field_declaration`](https://dart.dev/tools/linter-rules/initialize_in_field_declaration) - Remove deprecated lints - [`avoid_private_typedef_functions`](https://dart.dev/tools/linter-rules/avoid_private_typedef_functions) - [`one_member_abstracts`](https://dart.dev/tools/linter-rules/one_member_abstracts) - [`unnecessary_await_in_return`](https://dart.dev/tools/linter-rules/unnecessary_await_in_return)
5. Trigger Release Workflow (release-pub)
Once changes and CHANGELOG.md are prepared and verified:
- Trigger the
release-pubskill workflow to handle release publishing. - Ensure pre-release dry-run passes:
dart pub publish --dry-run - Request confirmation from the user before tagging and committing.
- Execute release git operations and GitHub release creation as defined in
release-pub.