diff --git a/dev/tools/dart_skills_lint.yaml b/dev/tools/dart_skills_lint.yaml new file mode 100644 index 0000000000000..3026701f87236 --- /dev/null +++ b/dev/tools/dart_skills_lint.yaml @@ -0,0 +1,10 @@ +# Copyright 2014 The Flutter Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +dart_skills_lint: + rules: + check-relative-paths: error + check-absolute-paths: error + check-trailing-whitespace: error + directories: + - path: ".agents/skills" diff --git a/dev/tools/pubspec.yaml b/dev/tools/pubspec.yaml index f8ef9fd24fcb9..515bc9dd3a5a7 100644 --- a/dev/tools/pubspec.yaml +++ b/dev/tools/pubspec.yaml @@ -26,7 +26,7 @@ dependencies: git: url: https://github.com/flutter/skills path: tool/dart_skills_lint - ref: 9eff6bbcfa27c2724ea9ad67a611c19fe77057ea + ref: e4497873950727ee781fa411c1a2f624b1ec50c6 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 0cbcc0cd29973..ce0262b7183a8 100644 --- a/dev/tools/test/validate_skills_test.dart +++ b/dev/tools/test/validate_skills_test.dart @@ -11,6 +11,8 @@ import 'package:test/test.dart'; import 'check_backticks_relative_paths_rule.dart'; +const String _configFileName = 'dart_skills_lint.yaml'; + Directory _findSkillsDir() { Directory dir = Directory.current; while (dir.path != dir.parent.path) { @@ -47,14 +49,10 @@ void main() { }); test('Validate Flutter Skills', () async { - final bool isValid = await validateSkills( - skillDirPaths: [skillsDirectory], - resolvedRules: { - 'check-relative-paths': AnalysisSeverity.error, - 'check-absolute-paths': AnalysisSeverity.error, - 'check-trailing-whitespace': AnalysisSeverity.error, - }, + final Configuration config = await ConfigParser.loadConfig( + path: path.join(repoRoot.path, 'dev', 'tools', _configFileName), ); + final bool isValid = await validateSkills(skillDirPaths: [skillsDirectory], config: config); expect(isValid, isTrue, reason: 'Skills validation failed. See above for details.'); }); @@ -85,7 +83,15 @@ void main() { final bool isValid = await validateSkills( skillDirPaths: [skillsDirectory], customRules: [CheckBackticksRelativePathsRule(valid2SegmentPaths, repoRoot.path)], - resolvedRules: {'check-absolute-paths': AnalysisSeverity.disabled}, + 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, + }, ); expect(isValid, isTrue, reason: 'Skills validation failed. See above for details.'); }); diff --git a/pubspec.lock b/pubspec.lock index 07704de1f6392..6d11957cc426d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -238,11 +238,11 @@ packages: dependency: transitive description: path: "tool/dart_skills_lint" - ref: "9eff6bbcfa27c2724ea9ad67a611c19fe77057ea" - resolved-ref: "9eff6bbcfa27c2724ea9ad67a611c19fe77057ea" + ref: e4497873950727ee781fa411c1a2f624b1ec50c6 + resolved-ref: e4497873950727ee781fa411c1a2f624b1ec50c6 url: "https://github.com/flutter/skills" source: git - version: "0.2.0" + version: "0.3.0" dart_style: dependency: "direct main" description: