mirror of
https://github.com/dart-lang/sdk
synced 2024-10-01 19:14:49 +00:00
[pkg/js_*] use package:lints/recommended.yaml for analysis for pkg/js_shared and pkg/js_runtime
Update the pkg/pkg.dart script to also include information about the size of the pkg/ packages (so we know ~how much code is on older analysis options sets). Change-Id: Ief1b9a868752a01aef5dd95a4ce1c74795315bc4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290615 Reviewed-by: Srujan Gaddam <srujzs@google.com> Commit-Queue: Devon Carew <devoncarew@google.com> Reviewed-by: Nate Bosch <nbosch@google.com>
This commit is contained in:
parent
0ac7c843ee
commit
e6ee09e23b
|
@ -1 +1 @@
|
|||
include: package:lints/core.yaml
|
||||
include: package:lints/recommended.yaml
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
// 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.
|
||||
|
||||
// ignore_for_file: constant_identifier_names
|
||||
|
||||
/// Contains error codes that transformed async/async* functions use to
|
||||
/// communicate with js_helper functions.
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
// 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.
|
||||
|
||||
// ignore_for_file: constant_identifier_names, library_names
|
||||
|
||||
/// Contains the names of globals that are embedded into the output by the
|
||||
/// compiler.
|
||||
///
|
||||
|
|
|
@ -1 +1 @@
|
|||
include: package:lints/core.yaml
|
||||
include: package:lints/recommended.yaml
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
// 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.
|
||||
|
||||
// ignore_for_file: constant_identifier_names
|
||||
|
||||
/// A 'Universe' object used by 'dart:_rti'.
|
||||
const RTI_UNIVERSE = 'typeUniverse';
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
// 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.
|
||||
|
||||
// ignore_for_file: library_names
|
||||
|
||||
/// Constants and predicates used for encoding and decoding type recipes.
|
||||
///
|
||||
/// This library is synchronized between the compiler and the runtime system.
|
||||
|
|
33
pkg/pkg.dart
33
pkg/pkg.dart
|
@ -8,7 +8,7 @@
|
|||
import 'dart:io';
|
||||
|
||||
void main(List<String> args) {
|
||||
const indent = 24;
|
||||
const indent = 29;
|
||||
|
||||
var dirs = Directory('pkg').listSync().whereType<Directory>().toList();
|
||||
dirs.sort((a, b) => a.path.compareTo(b.path));
|
||||
|
@ -17,6 +17,8 @@ void main(List<String> args) {
|
|||
var pubspec = File('${dir.path}/pubspec.yaml');
|
||||
if (!pubspec.existsSync()) continue;
|
||||
|
||||
var sloc = _calcLines(dir) / 1024.0;
|
||||
var slocDesc = '(${sloc.toStringAsFixed(1).padLeft(6)}k lines)';
|
||||
var options = File('${dir.path}/analysis_options.yaml');
|
||||
var name = dir.path.split('/').last;
|
||||
|
||||
|
@ -28,9 +30,34 @@ void main(List<String> args) {
|
|||
} else if (optionsContent.contains('package:lints/recommended.yaml')) {
|
||||
type = 'recommended';
|
||||
}
|
||||
print('${name.padRight(indent)}: $type');
|
||||
print('${name.padRight(indent)}: ${type.padRight(12)} $slocDesc');
|
||||
} else {
|
||||
print('${name.padRight(indent)}: default');
|
||||
print('${name.padRight(indent)}: default $slocDesc');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int _calcLines(Directory dir) {
|
||||
var result = 0;
|
||||
|
||||
for (var entity in dir.listSync()) {
|
||||
if (entity.name.startsWith('.')) continue;
|
||||
|
||||
if (entity is Directory) {
|
||||
result += _calcLines(entity);
|
||||
} else {
|
||||
if (entity is File && entity.name.endsWith('.dart')) {
|
||||
result += entity
|
||||
.readAsLinesSync()
|
||||
.where((line) => line.trim().isNotEmpty)
|
||||
.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
extension FileSystemEntityExtension on FileSystemEntity {
|
||||
String get name => path.split('/').last;
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
// 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.
|
||||
|
||||
// ignore_for_file: constant_identifier_names
|
||||
|
||||
/// Contains error codes that transformed async/async* functions use to
|
||||
/// communicate with js_helper functions.
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
// 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.
|
||||
|
||||
// ignore_for_file: constant_identifier_names, library_names
|
||||
|
||||
/// Contains the names of globals that are embedded into the output by the
|
||||
/// compiler.
|
||||
///
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
// 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.
|
||||
|
||||
// ignore_for_file: constant_identifier_names
|
||||
|
||||
/// A 'Universe' object used by 'dart:_rti'.
|
||||
const RTI_UNIVERSE = 'typeUniverse';
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
// 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.
|
||||
|
||||
// ignore_for_file: library_names
|
||||
|
||||
/// Constants and predicates used for encoding and decoding type recipes.
|
||||
///
|
||||
/// This library is synchronized between the compiler and the runtime system.
|
||||
|
|
Loading…
Reference in a new issue