Files
flutter__agent-plugins/tool/generator/test/lint_skills_test.dart
2026-04-09 19:57:13 -04:00

35 lines
1.0 KiB
Dart

// Copyright (c) 2026, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:dart_skills_lint/dart_skills_lint.dart';
import 'package:logging/logging.dart';
import 'package:test/test.dart';
import 'custom_skill_rules/last_modified_rule.dart';
void main() {
test('Run skills linter', () async {
Logger.root.level = Level.ALL;
final subscription = Logger.root.onRecord.listen((record) {
printOnFailure('${record.level.name}: ${record.message}');
});
try {
expect(
await validateSkills(
skillDirPaths: ['../../skills'],
resolvedRules: {
'check-relative-paths': AnalysisSeverity.error,
'check-absolute-paths': AnalysisSeverity.error,
},
customRules: [LastModifiedRule()],
),
isTrue,
);
} finally {
await subscription.cancel();
}
});
}