Expose custom validators then use one for last_modified#72
Expose custom validators then use one for last_modified#72reidbaker merged 8 commits intoflutter:mainfrom
Conversation
There was a problem hiding this comment.
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.
|
/gemini review |
There was a problem hiding this comment.
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.
|
/gemini review |
There was a problem hiding this comment.
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.
|
/gemini review |
There was a problem hiding this comment.
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.
This PR creates the pluggable rule architecture in
dart_skills_lintthen 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
///).