Skip to content

Update skills_lint to ^0.5.3 and enforce publisher rules - #257

Open
reidbaker-agent wants to merge 3 commits into
flutter:mainfrom
reidbaker-agent:update-skills-lint-0.5.3
Open

reidbaker-agent wants to merge 3 commits into
flutter:mainfrom
reidbaker-agent:update-skills-lint-0.5.3

Conversation

@reidbaker-agent

@reidbaker-agent reidbaker-agent commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Update to skills_lint 0.5.3 and enable new configs for published skills.

@reidbaker

Details

Description

This PR updates skills_lint in tool/generator from ^0.5.2 to ^0.5.3 and turns on two more checks for the skills in skills/.

Changes:

  • tool/generator/pubspec.yaml: skills_lint: ^0.5.3.
  • pubspec.yaml (workspace root) and tool/generator/pubspec.yaml: sdk: ^3.12.0 (was ^3.10.8). skills_lint 0.5.3 requires Dart ^3.12.0, so dart pub get fails on older SDKs. CI uses sdk: stable (3.13.7 today), so CI is not affected.
  • tool/generator/skills_lint.yaml:
    • disallowed-field: error. This rule is not new in 0.5.3. It reports SKILL.md frontmatter keys that are not allowed.
    • check-relative-paths with within-skill: true on the ../../skills directory. This option is new in 0.5.3. It reports relative links that leave the skill's own folder, which break when one skill is installed on its own.
  • tool/generator/test/lint_skills_test.dart: adds expect(config.parsingErrors, isEmpty). The 0.5.3 CHANGELOG notes that validateSkills returns true even when config.parsingErrors is not empty. Without this check, a typo in skills_lint.yaml would pass the test.
  • Analyzer fixes that the SDK bump needs. With the 3.12 language version, Dart 3.13.7 stable reports 3 issues under dart analyze --fatal-infos. On main (3.10 language version) it reports none.
    • prefer_initializing_formals on the 2 private fields in ResourceFetcherService. Fixed with private named initializing formals (required this._httpClient). Callers still pass httpClient: and logger:.
    • deprecated_lint for use_if_null_to_convert_nulls_to_bools. Removed from analysis_options.yaml.

pub-archive-includes-skill (also new in 0.5.3) is not turned on, because this repo does not publish a pub package.

Merge order

Land the dart-lang/skills skills_lint 0.5.3 PR (dart-lang/skills#56) first, or at the same time. A daily job (sync_skills.yaml) copies skills/dart-* from dart-lang/skills into this repo. Today dart-lang/skills does not run disallowed-field or within-skill. If it adds content that breaks those rules, the sync PR here fails, and block-dart-skills-prs.yaml stops anyone from fixing those files here.

Testing

Run locally against skills_lint 0.5.3 from pub.dev, with no dependency overrides. Commands match skills_tool.yaml and code_scanning.yaml, run in tool/generator:

  • dart pub get: resolves skills_lint 0.5.3 from pub.dev.
  • dart analyze --fatal-infos: No issues found!
  • dart format --output=none --set-exit-if-changed .: 0 changed.
  • dart test: +101: All tests passed!
  • dart run skills_lint: all skills valid, exit 0. --format=sarif: 0 results.

This change was prepared with help from an AI agent.

skills_lint 0.5.3 requires Dart ^3.12.0. With the 3.12 language version,
Dart 3.13.7 stable reports prefer_initializing_formals on the private
fields of ResourceFetcherService and deprecated_lint on
use_if_null_to_convert_nulls_to_bools. Use private named initializing
formals (the public parameter names stay httpClient and logger) and drop
the deprecated lint.

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request updates the Dart SDK environment constraint to ^3.12.0, adjusts linter and skills_lint configurations, and adds a test assertion for parsing errors. In ResourceFetcherService, the constructor was refactored to use initializing formals for private fields. However, because named parameters starting with an underscore are private in Dart, this change will cause compilation errors for external callers. It is recommended to revert to public named parameters with an initializer list.

@reidbaker
reidbaker self-requested a review November 2, 2026 16:49
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.

2 participants