Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions dev/tools/dart_skills_lint.yaml
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion dev/tools/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
22 changes: 14 additions & 8 deletions dev/tools/test/validate_skills_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
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.

medium

The skillDirPaths argument appears redundant here because the config object (loaded from dart_skills_lint.yaml) already specifies the target directory (.agents/skills). Providing both might lead to the same directory being scanned twice, which contradicts the goal of optimizing validation overhead. Consider removing the explicit skillDirPaths if the configuration is intended to be the source of truth for the validation.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ConfigParser doesn't have .agent/skills in it...

expect(isValid, isTrue, reason: 'Skills validation failed. See above for details.');
});

Expand Down Expand Up @@ -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,
Comment thread
reidbaker marked this conversation as resolved.
},
);
expect(isValid, isTrue, reason: 'Skills validation failed. See above for details.');
});
Expand Down
6 changes: 3 additions & 3 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading