mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 08:24:39 +00:00
![Devon Carew](/assets/img/avatar_default.png)
Also, commit a small tool to pkg/pkg.dart to classify the analysis options settings used by the various pkg/ packages. Change-Id: I34087ed4d033cd2f679c378bcc9270ae65627ae2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/282392 Commit-Queue: Devon Carew <devoncarew@google.com> Reviewed-by: Nate Bosch <nbosch@google.com>
37 lines
1.2 KiB
Dart
37 lines
1.2 KiB
Dart
// Copyright (c) 2023, 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.
|
|
|
|
/// List the packages in pkg/ as well information about their
|
|
/// analysis_options.yaml configuration.
|
|
|
|
import 'dart:io';
|
|
|
|
void main(List<String> args) {
|
|
const indent = 24;
|
|
|
|
var dirs = Directory('pkg').listSync().whereType<Directory>().toList();
|
|
dirs.sort((a, b) => a.path.compareTo(b.path));
|
|
|
|
for (var dir in dirs) {
|
|
var pubspec = File('${dir.path}/pubspec.yaml');
|
|
if (!pubspec.existsSync()) continue;
|
|
|
|
var options = File('${dir.path}/analysis_options.yaml');
|
|
var name = dir.path.split('/').last;
|
|
|
|
if (options.existsSync()) {
|
|
var type = '** custom **';
|
|
var optionsContent = options.readAsStringSync();
|
|
if (optionsContent.contains('package:lints/core.yaml')) {
|
|
type = 'core';
|
|
} else if (optionsContent.contains('package:lints/recommended.yaml')) {
|
|
type = 'recommended';
|
|
}
|
|
print('${name.padRight(indent)}: $type');
|
|
} else {
|
|
print('${name.padRight(indent)}: default');
|
|
}
|
|
}
|
|
}
|