diff --git a/.agents/scripts/validate_skills_hook.sh b/.agents/scripts/validate_skills_hook.sh index 6456f0f2956..c83483a6365 100755 --- a/.agents/scripts/validate_skills_hook.sh +++ b/.agents/scripts/validate_skills_hook.sh @@ -13,10 +13,10 @@ TARGET_FILE=$(echo "$INPUT" | python3 -c "import sys, json; data=json.load(sys.s # Check if a skill file was modified if [[ "$TARGET_FILE" == *"SKILL.md"* ]] || [[ "$TARGET_FILE" == *".agents/skills"* ]]; then echo "Skill edit detected: $TARGET_FILE" >&2 - echo "Running dart_skills_lint..." >&2 + echo "Running skills_lint..." >&2 # Run the skills linter from tool/ directory - (cd tool && dart run dart_skills_lint:cli) + (cd tool && flutter pub run skills_lint) fi # PostToolUse expects an empty JSON object on stdout diff --git a/.agents/skills/adding-release-notes/scripts/add_note.dart b/.agents/skills/adding-release-notes/scripts/add_note.dart index 72ee6d2a2d9..97d8e9087a0 100644 --- a/.agents/skills/adding-release-notes/scripts/add_note.dart +++ b/.agents/skills/adding-release-notes/scripts/add_note.dart @@ -14,7 +14,7 @@ void main(List args) { final note = args[1].trim(); final pr = args[2].trim(); - final prLink = pr == 'TODO' + final prLink = pr == 'TODO' ? '[TODO](https://github.com/flutter/devtools/pull/TODO)' : '[#$pr](https://github.com/flutter/devtools/pull/$pr)'; @@ -52,15 +52,18 @@ void main(List args) { // Find the next section start or the end of the file. var nextSectionStart = content.indexOf('\n## ', sectionStart + 1); if (nextSectionStart == -1) { - nextSectionStart = - content.indexOf('\n# Full commit history', sectionStart + 1); + nextSectionStart = content.indexOf( + '\n# Full commit history', + sectionStart + 1, + ); } if (nextSectionStart == -1) { nextSectionStart = content.length; } - var sectionContent = - content.substring(sectionStart, nextSectionStart).trimRight(); + var sectionContent = content + .substring(sectionStart, nextSectionStart) + .trimRight(); sectionContent += '\n$newEntry'; content = diff --git a/.agents/skills/dart_skills_lint_ignore.json b/.agents/skills/skills_lint_ignore.json similarity index 100% rename from .agents/skills/dart_skills_lint_ignore.json rename to .agents/skills/skills_lint_ignore.json diff --git a/pubspec.lock b/pubspec.lock index e746a9dc16d..72b7d242fe6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -209,15 +209,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.0.3" - dart_skills_lint: - dependency: transitive - description: - path: "tool/dart_skills_lint" - ref: "05e5a45fa412ddbdd1d694eee0c71f4bbaea2617" - resolved-ref: "05e5a45fa412ddbdd1d694eee0c71f4bbaea2617" - url: "https://github.com/flutter/skills" - source: git - version: "0.4.0" dart_style: dependency: transitive description: @@ -758,6 +749,15 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.0" + skills_lint: + dependency: transitive + description: + path: "packages/skills_lint" + ref: e6e695e1550f81342fe5acd4dbe65040b5aa44c3 + resolved-ref: e6e695e1550f81342fe5acd4dbe65040b5aa44c3 + url: "https://github.com/google/skills_lint.dart.git" + source: git + version: "0.5.1" sky_engine: dependency: transitive description: flutter diff --git a/tool/pubspec.yaml b/tool/pubspec.yaml index 98aed9d5469..37053adf369 100644 --- a/tool/pubspec.yaml +++ b/tool/pubspec.yaml @@ -23,11 +23,11 @@ dependencies: yaml: ^3.1.2 dev_dependencies: + logging: ^1.1.1 # TODO(https://github.com/flutter/devtools/issues/9771): Update to published version - dart_skills_lint: + skills_lint: git: - url: https://github.com/flutter/skills - path: tool/dart_skills_lint - ref: 05e5a45fa412ddbdd1d694eee0c71f4bbaea2617 - logging: ^1.1.1 + url: https://github.com/google/skills_lint.dart.git + path: packages/skills_lint + ref: e6e695e1550f81342fe5acd4dbe65040b5aa44c3 test: ^1.25.8 diff --git a/tool/dart_skills_lint.yaml b/tool/skills_lint.yaml similarity index 95% rename from tool/dart_skills_lint.yaml rename to tool/skills_lint.yaml index 150e3900d15..14fbb78e053 100644 --- a/tool/dart_skills_lint.yaml +++ b/tool/skills_lint.yaml @@ -1,7 +1,7 @@ # Copyright 2026 The Flutter Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd. -dart_skills_lint: +skills_lint: rules: check-relative-paths: error check-absolute-paths: error diff --git a/tool/test/validate_skills_test.dart b/tool/test/validate_skills_test.dart index 04736e7c4b2..6adbabe61c4 100644 --- a/tool/test/validate_skills_test.dart +++ b/tool/test/validate_skills_test.dart @@ -3,11 +3,12 @@ // found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd. import 'dart:async'; -import 'package:dart_skills_lint/dart_skills_lint.dart'; + import 'package:logging/logging.dart'; +import 'package:skills_lint/skills_lint.dart'; import 'package:test/test.dart'; -const String _configFilePath = 'dart_skills_lint.yaml'; +const String _configFilePath = 'skills_lint.yaml'; void main() { test('Validate DevTools Skills', () async {