Skip to content

Expose custom validators then use one for last_modified#72

Merged
reidbaker merged 8 commits intoflutter:mainfrom
reidbaker:r-expose-custom-validators
Apr 10, 2026
Merged

Expose custom validators then use one for last_modified#72
reidbaker merged 8 commits intoflutter:mainfrom
reidbaker:r-expose-custom-validators

Conversation

@reidbaker
Copy link
Copy Markdown
Contributor

@reidbaker reidbaker commented Apr 10, 2026

This PR creates the pluggable rule architecture in dart_skills_lint then uses it to enforce that there is a last_modified field in all the fluter skills. It also completely refactors the way rules are defined to be more generic and make adding future rules easier to add.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read the Flutter Style Guide recently, and have followed its advice.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

@reidbaker reidbaker requested review from johnpryan and jwren April 10, 2026 00:01
Copy link
Copy Markdown

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

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 refactors the dart_skills_lint tool to a pluggable, rule-based architecture (version 0.2.0). It introduces the SkillRule base class and SkillContext, enabling the implementation of custom validation rules. The existing validation logic has been extracted from the Validator class into dedicated rule implementations such as AbsolutePathsRule, NameFormatRule, and ValidYamlMetadataRule. Feedback focuses on ensuring that the default severities defined in the new rule constructors are consistent with the default severities specified in their respective CheckType definitions to prevent unexpected behavior when rules are instantiated directly.

@reidbaker
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown

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

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 refactors the dart_skills_lint tool to a pluggable, rule-based architecture (version 0.2.0). It introduces the SkillRule and SkillContext models, allowing for custom validation rules. Built-in validation logic has been moved into dedicated rule classes registered in a new RuleRegistry. CLI flags are now dynamically generated from these rules. Feedback includes a suggestion to document a breaking change in CLI severity behavior in the changelog and a recommendation to simplify a redundant condition in the rule resolution logic.

@reidbaker
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown

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

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 refactors the dart_skills_lint validator into a pluggable, rule-based architecture, introducing the SkillRule base class and a RuleRegistry for managing built-in checks. It also adds support for custom rules, updates CLI flag handling to dynamically generate flags from registered rules, and improves path normalization for ignore entries. Feedback focuses on optimizing performance by centralizing the extraction of markdown content within SkillContext and pre-building the rule list in the Validator constructor to avoid redundant processing during batch validations.

@reidbaker
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown

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

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 refactors the dart_skills_lint tool to a pluggable rule-based architecture, introducing SkillRule and SkillContext to support custom validation rules. The Validator and CLI entry point have been updated to dynamically handle rules from a central registry, and the version has been bumped to 0.2.0. Review feedback focuses on optimizing performance by pre-calculating the markdown content (excluding YAML frontmatter) within the Validator and passing it via SkillContext to prevent redundant regex operations across multiple rules.

@reidbaker reidbaker merged commit 5e76e7f into flutter:main Apr 10, 2026
11 checks passed
@reidbaker reidbaker deleted the r-expose-custom-validators branch April 10, 2026 14:30
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.

1 participant