Migrate dev/tools skill validation to new dart_skills_lint API (#189626)
This update lets us use parameters in rules which is helpful for
ignoring a class of issues that shows up when doing evals that put
artifacts in the skills directories that are ignored by git but
otherwise cause false positives.
Ai authored description below
---
Bumps the pinned `dart_skills_lint` dependency ref to the latest main
commit (`05e5a45fa412ddbdd1d694eee0c71f4bbaea2617`) and migrates the
validation tests in `dev/tools` to use the new `resolvedRuleConfigs`
API.
- **Non-test code changed**: None (only `pubspec.yaml` and `test/`
suite).
- **Checks and Tests**: Validated locally that formatting, static
analysis, and all test suites pass cleanly.
---------
Co-authored-by: Reid Baker <reidbaker@google.com>
diff --git a/dev/tools/pubspec.yaml b/dev/tools/pubspec.yaml
index 545c813..6fbcedd 100644
--- a/dev/tools/pubspec.yaml
+++ b/dev/tools/pubspec.yaml
@@ -26,7 +26,7 @@
git:
url: https://github.com/flutter/skills
path: tool/dart_skills_lint
- ref: e4497873950727ee781fa411c1a2f624b1ec50c6
+ ref: 05e5a45fa412ddbdd1d694eee0c71f4bbaea2617
logging: ^1.3.0
dev_dependencies:
diff --git a/dev/tools/test/validate_skills_test.dart b/dev/tools/test/validate_skills_test.dart
index 3f70b03..02ba056 100644
--- a/dev/tools/test/validate_skills_test.dart
+++ b/dev/tools/test/validate_skills_test.dart
@@ -93,14 +93,14 @@
final bool isValid = await validateSkills(
skillDirPaths: [skillsDirectory, reidbakerSkillsDirectory],
customRules: [CheckBackticksRelativePathsRule(valid2SegmentPaths, repoRoot.path)],
- resolvedRules: {
- 'check-absolute-paths': AnalysisSeverity.disabled,
- 'check-relative-paths': AnalysisSeverity.disabled,
- 'check-trailing-whitespace': AnalysisSeverity.disabled,
- 'description-too-long': AnalysisSeverity.disabled,
- 'disallowed-field': AnalysisSeverity.disabled,
- 'invalid-skill-name': AnalysisSeverity.disabled,
- 'valid-yaml-metadata': AnalysisSeverity.disabled,
+ resolvedRuleConfigs: {
+ 'check-absolute-paths': const RuleConfigPatch(severity: AnalysisSeverity.disabled),
+ 'check-relative-paths': const RuleConfigPatch(severity: AnalysisSeverity.disabled),
+ 'check-trailing-whitespace': const RuleConfigPatch(severity: AnalysisSeverity.disabled),
+ 'description-too-long': const RuleConfigPatch(severity: AnalysisSeverity.disabled),
+ 'disallowed-field': const RuleConfigPatch(severity: AnalysisSeverity.disabled),
+ 'invalid-skill-name': const RuleConfigPatch(severity: AnalysisSeverity.disabled),
+ 'valid-yaml-metadata': const RuleConfigPatch(severity: AnalysisSeverity.disabled),
},
);
expect(isValid, isTrue, reason: 'Skills validation failed. See above for details.');
diff --git a/pubspec.lock b/pubspec.lock
index 83745bb..599bb5c 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -238,11 +238,11 @@
dependency: transitive
description:
path: "tool/dart_skills_lint"
- ref: e4497873950727ee781fa411c1a2f624b1ec50c6
- resolved-ref: e4497873950727ee781fa411c1a2f624b1ec50c6
+ ref: "05e5a45fa412ddbdd1d694eee0c71f4bbaea2617"
+ resolved-ref: "05e5a45fa412ddbdd1d694eee0c71f4bbaea2617"
url: "https://github.com/flutter/skills"
source: git
- version: "0.3.0"
+ version: "0.4.0"
dart_style:
dependency: "direct main"
description: