diff --git a/pkg/js_runtime/analysis_options.yaml b/pkg/js_runtime/analysis_options.yaml index c36c2c5d39f..572dd239d09 100644 --- a/pkg/js_runtime/analysis_options.yaml +++ b/pkg/js_runtime/analysis_options.yaml @@ -1 +1 @@ -include: package:lints/core.yaml +include: package:lints/recommended.yaml diff --git a/pkg/js_runtime/lib/synced/async_await_error_codes.dart b/pkg/js_runtime/lib/synced/async_await_error_codes.dart index f87406b31b0..f76f3de8b1d 100644 --- a/pkg/js_runtime/lib/synced/async_await_error_codes.dart +++ b/pkg/js_runtime/lib/synced/async_await_error_codes.dart @@ -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. diff --git a/pkg/js_runtime/lib/synced/embedded_names.dart b/pkg/js_runtime/lib/synced/embedded_names.dart index 66701f30031..517c0d3dec7 100644 --- a/pkg/js_runtime/lib/synced/embedded_names.dart +++ b/pkg/js_runtime/lib/synced/embedded_names.dart @@ -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. /// diff --git a/pkg/js_shared/analysis_options.yaml b/pkg/js_shared/analysis_options.yaml index c36c2c5d39f..572dd239d09 100644 --- a/pkg/js_shared/analysis_options.yaml +++ b/pkg/js_shared/analysis_options.yaml @@ -1 +1 @@ -include: package:lints/core.yaml +include: package:lints/recommended.yaml diff --git a/pkg/js_shared/lib/synced/embedded_names.dart b/pkg/js_shared/lib/synced/embedded_names.dart index 415356c6ec0..90656ed83d1 100644 --- a/pkg/js_shared/lib/synced/embedded_names.dart +++ b/pkg/js_shared/lib/synced/embedded_names.dart @@ -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'; diff --git a/pkg/js_shared/lib/synced/recipe_syntax.dart b/pkg/js_shared/lib/synced/recipe_syntax.dart index b761b3154c0..ed1aadd8f52 100644 --- a/pkg/js_shared/lib/synced/recipe_syntax.dart +++ b/pkg/js_shared/lib/synced/recipe_syntax.dart @@ -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. diff --git a/pkg/pkg.dart b/pkg/pkg.dart index 096246ec22e..0cc17e68274 100644 --- a/pkg/pkg.dart +++ b/pkg/pkg.dart @@ -8,7 +8,7 @@ import 'dart:io'; void main(List args) { - const indent = 24; + const indent = 29; var dirs = Directory('pkg').listSync().whereType().toList(); dirs.sort((a, b) => a.path.compareTo(b.path)); @@ -17,6 +17,8 @@ void main(List 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 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; +} diff --git a/sdk/lib/_internal/js_runtime/lib/synced/async_await_error_codes.dart b/sdk/lib/_internal/js_runtime/lib/synced/async_await_error_codes.dart index f87406b31b0..f76f3de8b1d 100644 --- a/sdk/lib/_internal/js_runtime/lib/synced/async_await_error_codes.dart +++ b/sdk/lib/_internal/js_runtime/lib/synced/async_await_error_codes.dart @@ -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. diff --git a/sdk/lib/_internal/js_runtime/lib/synced/embedded_names.dart b/sdk/lib/_internal/js_runtime/lib/synced/embedded_names.dart index 66701f30031..517c0d3dec7 100644 --- a/sdk/lib/_internal/js_runtime/lib/synced/embedded_names.dart +++ b/sdk/lib/_internal/js_runtime/lib/synced/embedded_names.dart @@ -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. /// diff --git a/sdk/lib/_internal/js_shared/lib/synced/embedded_names.dart b/sdk/lib/_internal/js_shared/lib/synced/embedded_names.dart index 415356c6ec0..90656ed83d1 100644 --- a/sdk/lib/_internal/js_shared/lib/synced/embedded_names.dart +++ b/sdk/lib/_internal/js_shared/lib/synced/embedded_names.dart @@ -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'; diff --git a/sdk/lib/_internal/js_shared/lib/synced/recipe_syntax.dart b/sdk/lib/_internal/js_shared/lib/synced/recipe_syntax.dart index b761b3154c0..ed1aadd8f52 100644 --- a/sdk/lib/_internal/js_shared/lib/synced/recipe_syntax.dart +++ b/sdk/lib/_internal/js_shared/lib/synced/recipe_syntax.dart @@ -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.