From fb60935b0c00597568984b3781865fe790371ca8 Mon Sep 17 00:00:00 2001 From: Alexei Sintotski Date: Mon, 14 Dec 2020 20:30:12 +0100 Subject: [PATCH] Compliance to recently introduced dart linter rules --- analysis_options.yaml | 19 ++ bin/main.dart | 8 +- bin/src/assert_pubspec_yaml_consistency.dart | 10 +- bin/src/commands/boot_command.dart | 32 ++-- bin/src/commands/evolve_command.dart | 26 ++- bin/src/commands/init_command.dart | 4 +- bin/src/commands/probe_command.dart | 11 +- bin/src/options/boot_mode.dart | 14 +- bin/src/options/dry_run.dart | 4 +- bin/src/options/lock.dart | 4 +- bin/src/options/verbose.dart | 4 +- bin/src/options/yaml.dart | 4 +- bin/src/resolve_dependencies.dart | 4 +- bin/src/scan_for_packages.dart | 8 +- bin/src/utils/borg_exception.dart | 4 +- bin/src/utils/git.dart | 4 +- bin/src/utils/platform_version.dart | 4 +- .../utils/print_dependency_usage_report.dart | 8 +- bin/src/utils/render_package_name.dart | 4 +- bin/src/utils/run_system_command.dart | 4 +- bin/src/utils/with_temp_location.dart | 4 +- ...gnored_lint_warning_for_generated_code.txt | 14 +- lib/src/boot_mode.dart | 4 +- ...compute_package_dependency_correction.dart | 19 +- lib/src/configuration/configuration.dart | 4 +- lib/src/configuration/configuration.g.dart | 14 +- lib/src/configuration/factory.dart | 4 +- lib/src/configuration/options/dart_sdk.dart | 4 +- lib/src/configuration/options/exclude.dart | 4 +- .../configuration/options/flutter_sdk.dart | 4 +- lib/src/configuration/options/paths.dart | 4 +- lib/src/context/borg_boot_context.dart | 4 +- lib/src/context/borg_context.dart | 4 +- lib/src/context/borg_context_factory.dart | 6 +- ...h_package_dependencies_from_reference.dart | 13 +- lib/src/dart_package/dart_package.dart | 4 +- .../dart_package/discover_dart_packages.dart | 4 +- lib/src/find_inconsistent_dependencies.dart | 16 +- .../find_inconsistent_dependency_specs.dart | 15 +- lib/src/generic_dependency_usage_report.dart | 9 +- ...all_external_package_dependency_specs.dart | 7 +- .../impact/impact_based_on_pubspec_yaml.dart | 4 +- lib/src/utils/file_finder.dart | 4 +- lib/src/utils/file_io.dart | 4 +- lib/src/utils/lazy_data.dart | 4 +- ...te_package_dependency_correction_test.dart | 4 +- ...reate_initial_configuration_file_test.dart | 8 +- ...creation_with_configuration_file_test.dart | 84 +++++---- ...ation_without_configuration_file_test.dart | 4 +- .../borg_boot_context_serialization_test.dart | 61 ++++--- ...kage_dependencies_from_reference_test.dart | 23 +-- test/dart_package/dart_package_test.dart | 4 +- test/dependency_test_dataset.dart | 4 +- test/find_inconsistent_dependencies_test.dart | 26 +-- ...nd_inconsistent_dependency_specs_test.dart | 164 ++++++++++-------- ...xternal_package_dependency_specs_test.dart | 73 ++++---- .../impact_based_on_pubspec_yaml_test.dart | 74 ++++---- test/utils/lazy_data_test.dart | 4 +- 58 files changed, 494 insertions(+), 396 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index b85620d..dbc97e9 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -19,6 +19,7 @@ linter: - avoid_double_and_int_checks - avoid_empty_else - avoid_equals_and_hash_code_on_mutable_classes + - avoid_escaping_inner_quotes - avoid_field_initializers_in_const_classes - avoid_function_literals_in_foreach_calls - avoid_implementing_value_types @@ -28,6 +29,7 @@ linter: - avoid_positional_boolean_parameters - avoid_print - avoid_private_typedef_functions + - avoid_redundant_argument_values - avoid_relative_lib_imports - avoid_renaming_method_parameters - avoid_return_types_on_setters @@ -57,9 +59,11 @@ linter: - curly_braces_in_flow_control_structures - diagnostic_describe_all_properties - directives_ordering + - do_not_use_environment - empty_catches - empty_constructor_bodies - empty_statements + - exhaustive_cases - file_names - flutter_style_todos - hash_and_equals @@ -67,12 +71,18 @@ linter: - invariant_booleans - iterable_contains_unrelated_type - join_return_with_assignment + - leading_newlines_in_multiline_strings - library_names - library_prefixes + - lines_longer_than_80_chars - list_remove_unrelated_type - literal_only_boolean_expressions + - missing_whitespace_between_adjacent_strings - no_adjacent_strings_in_list + - no_default_cases - no_duplicate_case_values + - no_logic_in_create_state + - no_runtimeType_toString - non_constant_identifier_names - null_closures - omit_local_variable_types @@ -123,6 +133,7 @@ linter: - provide_deprecation_message - public_member_api_docs - recursive_getters + - sized_box_for_whitespace - slash_for_doc_comments - sort_child_properties_last - sort_constructors_first @@ -141,14 +152,22 @@ linter: - unnecessary_new - unnecessary_null_aware_assignments - unnecessary_null_in_if_null_operators + - unnecessary_nullable_for_final_variable_declarations - unnecessary_overrides - unnecessary_parenthesis + - unnecessary_raw_strings - unnecessary_statements + - unnecessary_string_escapes + - unnecessary_string_interpolations - unnecessary_this - unrelated_type_equality_checks - unsafe_html - use_full_hex_values_for_flutter_colors - use_function_type_syntax_for_parameters + - use_is_even_rather_than_modulo + - use_key_in_widget_constructors + - use_late_for_private_fields_and_variables + - use_raw_strings - use_rethrow_when_possible - use_setters_to_change_properties - use_string_buffers diff --git a/bin/main.dart b/bin/main.dart index 152391c..098c807 100644 --- a/bin/main.dart +++ b/bin/main.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -32,8 +32,8 @@ import 'src/commands/probe_command.dart'; void main(List args) => CommandRunner( 'borg', - 'Dart borg is a command-line tool to support development teams working on ' - 'large scale Dart and Flutter mono repositories.', + 'Dart borg is a command-line tool to support development teams working ' + 'on large scale Dart and Flutter mono repositories.', ) ..addCommand(ProbeCommand()) ..addCommand(EvolveCommand()) diff --git a/bin/src/assert_pubspec_yaml_consistency.dart b/bin/src/assert_pubspec_yaml_consistency.dart index fa72296..565253c 100644 --- a/bin/src/assert_pubspec_yaml_consistency.dart +++ b/bin/src/assert_pubspec_yaml_consistency.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -57,7 +57,7 @@ String _formatDependencySpec(PackageDependencySpec dependency) => some: (v) => ": $v", none: () => "", )}', - path: (dep) => '${dep.path}', - hosted: (dep) => '${dep.version.valueOr(() => "unspecified")}', - sdk: (dep) => '${dep.version.valueOr(() => "unspecified")}', + path: (dep) => dep.path, + hosted: (dep) => dep.version.valueOr(() => 'unspecified'), + sdk: (dep) => dep.version.valueOr(() => 'unspecified'), ); diff --git a/bin/src/commands/boot_command.dart b/bin/src/commands/boot_command.dart index de5b3b7..5291164 100644 --- a/bin/src/commands/boot_command.dart +++ b/bin/src/commands/boot_command.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -63,9 +63,10 @@ class BootCommand extends Command { @override String get description => 'Executes "pub get" for multiple packages in repository\n\n' - 'Packages to bootstrap can be specified as arguments. ' - 'If no arguments are supplied, the command bootstraps all scanned packages.\n' - '"flutter packages get" is used to resolve dependencies for Flutter packages.'; + 'Packages to bootstrap can be specified as arguments. If no arguments ' + 'are supplied, the command bootstraps all scanned packages.\n' + '"flutter packages get" is used to resolve dependencies for Flutter ' + 'packages.'; @override String get name => 'boot'; @@ -99,7 +100,9 @@ class BootCommand extends Command { case BootMode.incremental: if (_isPartialBootstrappingRequested()) { print( - 'Bootstrapping of specific packages is requested, using basic bootstrapping\n'); + 'Bootstrapping of specific packages is requested, ' + 'using basic bootstrapping\n', + ); _executeBasicBootstrapping( packages: packages, configuration: configuration, @@ -175,9 +178,11 @@ class BootCommand extends Command { if (ctx.dartSdkVersion != dartSdkVersion && ctx.dartSdkVersion.isNotEmpty) { print( - 'Dart version change detected, bootstrapping of all packages required\n' - '\t${ctx.dartSdkVersion}\n' - '=> \t$dartSdkVersion\n'); + 'Dart version change detected, ' + 'bootstrapping of all packages required\n' + '\t${ctx.dartSdkVersion}\n' + '=> \t$dartSdkVersion\n', + ); return packages; } @@ -255,8 +260,8 @@ class BootCommand extends Command { final actualVersion = flutterSdkVersion(flutterSdkPath: flutterSdkPath); if (actualVersion != ctxVersion) { - print( - 'Flutter version change detected, bootstrapping of all packages required\n\n' + print('Flutter version change detected, ' + 'bootstrapping of all packages required\n\n' '$ctxVersion\n\n' '=>\n\n' '$actualVersion\n'); @@ -284,8 +289,9 @@ class BootCommand extends Command { for (final package in packages) { final counter = '[${i++}/${packages.length}]'; print( - '$counter ${package.isFlutterPackage ? 'Flutter' : 'Dart'} package ${renderPackageName(package.path)}...'); - + '$counter ${package.isFlutterPackage ? 'Flutter' : 'Dart'} ' + 'package ${renderPackageName(package.path)}...', + ); resolveDependencies( package: package, configuration: configuration, diff --git a/bin/src/commands/evolve_command.dart b/bin/src/commands/evolve_command.dart index e01816c..58d3331 100644 --- a/bin/src/commands/evolve_command.dart +++ b/bin/src/commands/evolve_command.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -86,14 +86,20 @@ class EvolveCommand extends Command { } print( - '\nResolving ${allExternalDepSpecs.length} direct external dependencies used by all found packages...'); + '\nResolving ${allExternalDepSpecs.length} direct external dependencies ' + 'used by all found packages...', + ); final references = _resolveConsistentDependencySet(allExternalDepSpecs); print( - '\tresolved ${references.length} direct and transitive external dependencies'); + '\tresolved ${references.length} direct and transitive external ' + 'dependencies', + ); if (getDryRunFlag(argResults)) { print( - '\nDRY RUN: Previewing evolution of ${packages.length} Dart packages...'); + '\nDRY RUN: Previewing evolution of ${packages.length} Dart ' + 'packages...', + ); } else { print('\nCommencing evolution of ${packages.length} Dart packages...'); } @@ -217,15 +223,17 @@ void _printDependencyCorrections({ final orgDep = actualDependencies .firstWhere((d) => d.package() == correction.package()); print( - '\t${correction.package()}: ${_formatDependencyDetail(orgDep)} => ${_formatDependencyDetail(correction)}'); + '\t${correction.package()}: ${_formatDependencyDetail(orgDep)} => ' + '${_formatDependencyDetail(correction)}', + ); } stdout.write('\n'); } } String _formatDependencyDetail(PackageDependency dep) => dep.iswitch( - sdk: (d) => '${d.version}', - hosted: (d) => '${d.version}', + sdk: (d) => d.version, + hosted: (d) => d.version, git: (d) => '${d.url}:${d.resolvedRef}', - path: (d) => '${d.path}', + path: (d) => d.path, ); diff --git a/bin/src/commands/init_command.dart b/bin/src/commands/init_command.dart index 995fc4e..aee52d5 100644 --- a/bin/src/commands/init_command.dart +++ b/bin/src/commands/init_command.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/bin/src/commands/probe_command.dart b/bin/src/commands/probe_command.dart index d7fa2d7..a507241 100644 --- a/bin/src/commands/probe_command.dart +++ b/bin/src/commands/probe_command.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -88,7 +88,8 @@ class ProbeCommand extends Command { } if (getPubspecYamlFlag(argResults) || getPubspecLockFlag(argResults)) { print( - '\nSUCCESS: All packages use consistent set of external dependencies'); + '\nSUCCESS: All packages use consistent set of external dependencies', + ); } else { throw const BorgException('FATAL: Nothing to do!'); } @@ -127,6 +128,6 @@ class ProbeCommand extends Command { String _formatDependencyInfo(PackageDependency dependency) => dependency.iswitcho( git: (dep) => '${dep.url}:${dep.resolvedRef}', - path: (dep) => '${dep.path}', - otherwise: () => '${dependency.version()}', + path: (dep) => dep.path, + otherwise: () => dependency.version(), ); diff --git a/bin/src/options/boot_mode.dart b/bin/src/options/boot_mode.dart index 8f6f339..868cfab 100644 --- a/bin/src/options/boot_mode.dart +++ b/bin/src/options/boot_mode.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -32,7 +32,8 @@ void addBootModeOption(ArgParser argParser, {@required BootMode defaultsTo}) => _name, abbr: 'm', help: - 'Switches borg to the specified bootstrapping mode -- all subsequent borg runs will use the specified mode ' + 'Switches borg to the specified bootstrapping mode -- all subsequent ' + 'borg runs will use the specified mode ' 'until another mode is selected in command line', allowed: [ _basicValue, @@ -40,10 +41,11 @@ void addBootModeOption(ArgParser argParser, {@required BootMode defaultsTo}) => ], allowedHelp: { _basicValue: - 'Switches borg to bootstrap all packages found during package scan or specified in the command line', + 'Switches borg to bootstrap all packages found during package scan ' + 'or specified in the command line', _incrementalValue: - 'Switches borg to bootstrap only packages with dependencies updated since the last successful ' - 'bootstrapping', + 'Switches borg to bootstrap only packages with dependencies ' + 'updated since the last successful bootstrapping', }, defaultsTo: _optionEnum2String[defaultsTo], ); diff --git a/bin/src/options/dry_run.dart b/bin/src/options/dry_run.dart index aa97f21..0f9e405 100644 --- a/bin/src/options/dry_run.dart +++ b/bin/src/options/dry_run.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/bin/src/options/lock.dart b/bin/src/options/lock.dart index f349cf5..11095d8 100644 --- a/bin/src/options/lock.dart +++ b/bin/src/options/lock.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/bin/src/options/verbose.dart b/bin/src/options/verbose.dart index e0bb00a..36b1132 100644 --- a/bin/src/options/verbose.dart +++ b/bin/src/options/verbose.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/bin/src/options/yaml.dart b/bin/src/options/yaml.dart index 827a5b1..a803e76 100644 --- a/bin/src/options/yaml.dart +++ b/bin/src/options/yaml.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/bin/src/resolve_dependencies.dart b/bin/src/resolve_dependencies.dart index 2ffef92..017d654 100644 --- a/bin/src/resolve_dependencies.dart +++ b/bin/src/resolve_dependencies.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/bin/src/scan_for_packages.dart b/bin/src/scan_for_packages.dart index f3cdacc..31b33c5 100644 --- a/bin/src/scan_for_packages.dart +++ b/bin/src/scan_for_packages.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -49,7 +49,9 @@ Iterable scanForPackages({ if (packages.isEmpty) { throw const BorgException( - 'FATAL: No Dart packages found, check borg configuration and command-line!'); + 'FATAL: No Dart packages found, check borg configuration and ' + 'command-line!', + ); } if (getVerboseFlag(argResults)) { diff --git a/bin/src/utils/borg_exception.dart b/bin/src/utils/borg_exception.dart index 49acda0..d8ae295 100644 --- a/bin/src/utils/borg_exception.dart +++ b/bin/src/utils/borg_exception.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/bin/src/utils/git.dart b/bin/src/utils/git.dart index e72f99f..fc2c367 100644 --- a/bin/src/utils/git.dart +++ b/bin/src/utils/git.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/bin/src/utils/platform_version.dart b/bin/src/utils/platform_version.dart index 5bcb5cd..2ca84af 100644 --- a/bin/src/utils/platform_version.dart +++ b/bin/src/utils/platform_version.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/bin/src/utils/print_dependency_usage_report.dart b/bin/src/utils/print_dependency_usage_report.dart index 3bebb18..8ca5086 100644 --- a/bin/src/utils/print_dependency_usage_report.dart +++ b/bin/src/utils/print_dependency_usage_report.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -35,7 +35,9 @@ void printDependencyUsageReport({ for (final use in report ..sort((a, b) => a.dependencyName.compareTo(b.dependencyName))) { print( - '\n${use.dependencyName}: inconsistent dependency specifications detected'); + '\n${use.dependencyName}: ' + 'inconsistent dependency specifications detected', + ); for (final dependency in use.references.keys) { print('\tVersion ${formatDependency(dependency)} is used by:'); for (final user in use.references[dependency]) { diff --git a/bin/src/utils/render_package_name.dart b/bin/src/utils/render_package_name.dart index 10aec68..c86465f 100644 --- a/bin/src/utils/render_package_name.dart +++ b/bin/src/utils/render_package_name.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/bin/src/utils/run_system_command.dart b/bin/src/utils/run_system_command.dart index 9292a5d..97e6208 100644 --- a/bin/src/utils/run_system_command.dart +++ b/bin/src/utils/run_system_command.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/bin/src/utils/with_temp_location.dart b/bin/src/utils/with_temp_location.dart index d4a33bc..8af7f3a 100644 --- a/bin/src/utils/with_temp_location.dart +++ b/bin/src/utils/with_temp_location.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/dev/ignored_lint_warning_for_generated_code.txt b/dev/ignored_lint_warning_for_generated_code.txt index d004ce9..288c654 100644 --- a/dev/ignored_lint_warning_for_generated_code.txt +++ b/dev/ignored_lint_warning_for_generated_code.txt @@ -1,17 +1,5 @@ -// ignore_for_file: ARGUMENT_TYPE_NOT_ASSIGNABLE -// ignore_for_file: always_put_required_named_parameters_first -// ignore_for_file: always_require_non_null_named_parameters -// ignore_for_file: annotate_overrides // ignore_for_file: avoid_annotating_with_dynamic -// ignore_for_file: avoid_classes_with_only_static_members -// ignore_for_file: avoid_equals_and_hash_code_on_mutable_classes -// ignore_for_file: implicit_dynamic_parameter -// ignore_for_file: join_return_with_assignment -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: prefer_asserts_with_message -// ignore_for_file: prefer_expression_function_bodies +// ignore_for_file: lines_longer_than_80_chars // ignore_for_file: prefer_single_quotes // ignore_for_file: public_member_api_docs -// ignore_for_file: sort_constructors_first -// ignore_for_file: type_annotate_public_apis diff --git a/lib/src/boot_mode.dart b/lib/src/boot_mode.dart index 8e4bdb7..761ac77 100644 --- a/lib/src/boot_mode.dart +++ b/lib/src/boot_mode.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/lib/src/compute_package_dependency_correction.dart b/lib/src/compute_package_dependency_correction.dart index 1fbd9ca..12b8910 100644 --- a/lib/src/compute_package_dependency_correction.dart +++ b/lib/src/compute_package_dependency_correction.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -25,14 +25,17 @@ import 'package:pubspec_lock/pubspec_lock.dart'; -/// Given the collection of actual package dependencies (deps) and the reference dependencies (references), -/// this function determines delta between the two collections and returns package versions to be used as package -/// dependencies instead of the ones used in deps to make it consistent with references. +/// Given the collection of actual package dependencies (deps) and the +/// reference dependencies (references), this function determines delta between +/// the two collections and returns package versions to be used as package +/// dependencies instead of the ones used in deps to make it consistent with +/// references. /// -/// This function is intended to calculate correction to a package configuration to make it consistent with other -/// packages in a Dart mono repository. +/// This function is intended to calculate correction to a package configuration +/// to make it consistent with other packages in a Dart mono repository. /// -/// In case deps is already consistent with references, the empty set is returned. +/// In case deps is already consistent with references, the empty set is +/// returned. /// Iterable computePackageDependencyCorrection( Iterable deps, diff --git a/lib/src/configuration/configuration.dart b/lib/src/configuration/configuration.dart index 51edd12..351d735 100644 --- a/lib/src/configuration/configuration.dart +++ b/lib/src/configuration/configuration.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/lib/src/configuration/configuration.g.dart b/lib/src/configuration/configuration.g.dart index dd247f0..014f8e1 100644 --- a/lib/src/configuration/configuration.g.dart +++ b/lib/src/configuration/configuration.g.dart @@ -62,19 +62,7 @@ class BorgConfiguration$ { (s_, excludedPaths) => s_.copyWith(excludedPaths: excludedPaths)); } -// ignore_for_file: ARGUMENT_TYPE_NOT_ASSIGNABLE -// ignore_for_file: always_put_required_named_parameters_first -// ignore_for_file: always_require_non_null_named_parameters -// ignore_for_file: annotate_overrides // ignore_for_file: avoid_annotating_with_dynamic -// ignore_for_file: avoid_classes_with_only_static_members -// ignore_for_file: avoid_equals_and_hash_code_on_mutable_classes -// ignore_for_file: implicit_dynamic_parameter -// ignore_for_file: join_return_with_assignment -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: prefer_asserts_with_message -// ignore_for_file: prefer_expression_function_bodies +// ignore_for_file: lines_longer_than_80_chars // ignore_for_file: prefer_single_quotes // ignore_for_file: public_member_api_docs -// ignore_for_file: sort_constructors_first -// ignore_for_file: type_annotate_public_apis diff --git a/lib/src/configuration/factory.dart b/lib/src/configuration/factory.dart index 873e4f8..6a6053b 100644 --- a/lib/src/configuration/factory.dart +++ b/lib/src/configuration/factory.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/lib/src/configuration/options/dart_sdk.dart b/lib/src/configuration/options/dart_sdk.dart index 2f230a2..febf9bb 100644 --- a/lib/src/configuration/options/dart_sdk.dart +++ b/lib/src/configuration/options/dart_sdk.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/lib/src/configuration/options/exclude.dart b/lib/src/configuration/options/exclude.dart index 5e8e566..e1e3de4 100644 --- a/lib/src/configuration/options/exclude.dart +++ b/lib/src/configuration/options/exclude.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/lib/src/configuration/options/flutter_sdk.dart b/lib/src/configuration/options/flutter_sdk.dart index 0d77a7d..2b3a11a 100644 --- a/lib/src/configuration/options/flutter_sdk.dart +++ b/lib/src/configuration/options/flutter_sdk.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/lib/src/configuration/options/paths.dart b/lib/src/configuration/options/paths.dart index de7c1ae..fec1734 100644 --- a/lib/src/configuration/options/paths.dart +++ b/lib/src/configuration/options/paths.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/lib/src/context/borg_boot_context.dart b/lib/src/context/borg_boot_context.dart index d6afa83..1a9cebe 100644 --- a/lib/src/context/borg_boot_context.dart +++ b/lib/src/context/borg_boot_context.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/lib/src/context/borg_context.dart b/lib/src/context/borg_context.dart index c6fd95d..f90cc70 100644 --- a/lib/src/context/borg_context.dart +++ b/lib/src/context/borg_context.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/lib/src/context/borg_context_factory.dart b/lib/src/context/borg_context_factory.dart index 499fe1e..7387eff 100644 --- a/lib/src/context/borg_context_factory.dart +++ b/lib/src/context/borg_context_factory.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -52,7 +52,7 @@ class BorgContextFactory { // ignore: avoid_as json.decode(json.encode(loadYaml(content))) as Map, ), - none: () => const BorgContext(bootContext: Optional.none()), + none: () => const BorgContext(), ); void save({@required BorgContext context}) => _saveStringToFileSync( diff --git a/lib/src/copy_with_package_dependencies_from_reference.dart b/lib/src/copy_with_package_dependencies_from_reference.dart index 48c95d1..eb1aa80 100644 --- a/lib/src/copy_with_package_dependencies_from_reference.dart +++ b/lib/src/copy_with_package_dependencies_from_reference.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -25,12 +25,13 @@ import 'package:pubspec_lock/pubspec_lock.dart'; -/// Given the collections of actual package dependencies (deps) and the reference dependencies (references), -/// this function copies deps and for every dependency version different from references, it takes the one from +/// Given the collections of actual package dependencies (deps) and the +/// reference dependencies (references), this function copies deps and for every +/// dependency version different from references, it takes the one from /// references. /// -/// This function is intended to correct package configuration to make it consistent with other packages in a Dart -/// mono repository. +/// This function is intended to correct package configuration to make it +/// consistent with other packages in a Dart mono repository. /// Iterable copyWithPackageDependenciesFromReference( Iterable deps, diff --git a/lib/src/dart_package/dart_package.dart b/lib/src/dart_package/dart_package.dart index 48ba2eb..a2d9bbd 100644 --- a/lib/src/dart_package/dart_package.dart +++ b/lib/src/dart_package/dart_package.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/lib/src/dart_package/discover_dart_packages.dart b/lib/src/dart_package/discover_dart_packages.dart index 29c6f47..d9d67c3 100644 --- a/lib/src/dart_package/discover_dart_packages.dart +++ b/lib/src/dart_package/discover_dart_packages.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/lib/src/find_inconsistent_dependencies.dart b/lib/src/find_inconsistent_dependencies.dart index 5ee4c42..72bdbe5 100644 --- a/lib/src/find_inconsistent_dependencies.dart +++ b/lib/src/find_inconsistent_dependencies.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -27,13 +27,15 @@ import 'package:pubspec_lock/pubspec_lock.dart'; import 'generic_dependency_usage_report.dart'; -/// Finds inconsistent set of external dependencies in the provided set of pubspec.lock content and -/// generates report on inconsistent package usage. -/// As analysis focuses on consistency of external dependencies, consistency of path dependencies is ignored. -/// However, if a dependency is specified by a mix of path and other dependency types in different pubspec.yaml files, +/// Finds inconsistent set of external dependencies in the provided set of +/// pubspec.lock content and generates report on inconsistent package usage. +/// As analysis focuses on consistency of external dependencies, consistency of +/// path dependencies is ignored. However, if a dependency is specified by a +/// mix of path and other dependency types in different pubspec.yaml files, /// this case is reported as inconsistency. /// -/// NB: To simplify implementation at this moment, version specifications are compared as strings, not semantically. +/// NB: To simplify implementation at this moment, version specifications are +/// compared as strings, not semantically. /// List> findInconsistentDependencies( Map pubspecLocks) { diff --git a/lib/src/find_inconsistent_dependency_specs.dart b/lib/src/find_inconsistent_dependency_specs.dart index c638af2..833e7f0 100644 --- a/lib/src/find_inconsistent_dependency_specs.dart +++ b/lib/src/find_inconsistent_dependency_specs.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -27,11 +27,12 @@ import 'package:pubspec_yaml/pubspec_yaml.dart'; import 'generic_dependency_usage_report.dart'; -/// Finds inconsistent set of external dependency specifications in the provided set of pubspec.yaml content and -/// generates report on inconsistent references. -/// As analysis focuses on consistency of external dependencies, consistency of path dependencies is ignored. -/// However, if a dependency is specified by a mix of path and other dependency types in different pubspec.yaml files, -/// this case is reported as inconsistency. +/// Finds inconsistent set of external dependency specifications in the provided +/// set of pubspec.yaml content and generates report on inconsistent references. +/// As analysis focuses on consistency of external dependencies, consistency of +/// path dependencies is ignored. However, if a dependency is specified by a mix +/// of path and other dependency types in different pubspec.yaml files, this +/// case is reported as inconsistency. /// List> findInconsistentDependencySpecs(Map pubspecYamls) { diff --git a/lib/src/generic_dependency_usage_report.dart b/lib/src/generic_dependency_usage_report.dart index 52d53c0..b438b4f 100644 --- a/lib/src/generic_dependency_usage_report.dart +++ b/lib/src/generic_dependency_usage_report.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -40,8 +40,9 @@ class DependencyUsageReport { final Map> references; @override - String toString() => - 'DependencyUsageReport<$DependencyType>(dependencyName: $dependencyName, references: $references)'; + String toString() => 'DependencyUsageReport<$DependencyType>(' + 'dependencyName: $dependencyName, ' + 'references: $references)'; @override // ignore: avoid_annotating_with_dynamic diff --git a/lib/src/get_all_external_package_dependency_specs.dart b/lib/src/get_all_external_package_dependency_specs.dart index b82f5ad..7a473ab 100644 --- a/lib/src/get_all_external_package_dependency_specs.dart +++ b/lib/src/get_all_external_package_dependency_specs.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -25,7 +25,8 @@ import 'package:pubspec_yaml/pubspec_yaml.dart'; -/// This function returns all package dependency specifications used in a collection of pubspec.yaml files. +/// This function returns all package dependency specifications used in a +/// collection of pubspec.yaml files. /// /// Package dependency overrides are taken into account. /// diff --git a/lib/src/impact/impact_based_on_pubspec_yaml.dart b/lib/src/impact/impact_based_on_pubspec_yaml.dart index 9b3f5a5..20d8351 100644 --- a/lib/src/impact/impact_based_on_pubspec_yaml.dart +++ b/lib/src/impact/impact_based_on_pubspec_yaml.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/lib/src/utils/file_finder.dart b/lib/src/utils/file_finder.dart index 83b1e19..f281024 100644 --- a/lib/src/utils/file_finder.dart +++ b/lib/src/utils/file_finder.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/lib/src/utils/file_io.dart b/lib/src/utils/file_io.dart index 24fe669..5cbc097 100644 --- a/lib/src/utils/file_io.dart +++ b/lib/src/utils/file_io.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/lib/src/utils/lazy_data.dart b/lib/src/utils/lazy_data.dart index 8266b95..287ff8d 100644 --- a/lib/src/utils/lazy_data.dart +++ b/lib/src/utils/lazy_data.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/test/compute_package_dependency_correction_test.dart b/test/compute_package_dependency_correction_test.dart index 566062d..efc0a5e 100644 --- a/test/compute_package_dependency_correction_test.dart +++ b/test/compute_package_dependency_correction_test.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/test/configuration/create_initial_configuration_file_test.dart b/test/configuration/create_initial_configuration_file_test.dart index c4ffeec..09452a0 100644 --- a/test/configuration/create_initial_configuration_file_test.dart +++ b/test/configuration/create_initial_configuration_file_test.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -37,8 +37,8 @@ void main() { tryToReadFileSync: (_) => const Optional.none()); test( - 'creates initial configuration file with include entry referring to current directory', - () { + 'creates initial configuration file with include entry referring to ' + 'current directory', () { factory.createInitialConfigurationFile( saveStringToFileSync: (_, content) { final savedConfig = BorgConfiguration.fromJson(_toJson(content)); diff --git a/test/configuration/creation_with_configuration_file_test.dart b/test/configuration/creation_with_configuration_file_test.dart index 819a1c2..ad79c91 100644 --- a/test/configuration/creation_with_configuration_file_test.dart +++ b/test/configuration/creation_with_configuration_file_test.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -42,20 +42,24 @@ void main() { final config = factory.createConfiguration(argResults: argParser.parse([])); test( - 'it produces configuration with included paths according to the configuration file', - () { - expect(config.pathsToScan, [_includedLocation]); - }); + 'it produces configuration with included paths according to the ' + 'configuration file', + () { + expect(config.pathsToScan, [_includedLocation]); + }, + ); }); group('given command line with included paths defined', () { final config = factory.createConfiguration( argResults: argParser.parse(['--paths=$_includedLocation2'])); test( - 'it produces configuration with included paths according to the command line', - () { - expect(config.pathsToScan, [_includedLocation2]); - }); + 'it produces configuration with included paths according to the ' + 'command line', + () { + expect(config.pathsToScan, [_includedLocation2]); + }, + ); }); }); @@ -71,20 +75,24 @@ void main() { final config = factory.createConfiguration(argResults: argParser.parse([])); test( - 'it produces configuration with excluded paths according to the configuration file', - () { - expect(config.excludedPaths, [_excludedLocation]); - }); + 'it produces configuration with excluded paths according to the ' + 'configuration file', + () { + expect(config.excludedPaths, [_excludedLocation]); + }, + ); }); group('given command line with excluded paths defined', () { final config = factory.createConfiguration( argResults: argParser.parse(['--paths=$_excludedLocation2'])); test( - 'it produces configuration with excluded paths according to the command line', - () { - expect(config.pathsToScan, [_excludedLocation2]); - }); + 'it produces configuration with excluded paths according to ' + 'the command line', + () { + expect(config.pathsToScan, [_excludedLocation2]); + }, + ); }); }); @@ -100,20 +108,24 @@ void main() { final config = factory.createConfiguration(argResults: argParser.parse([])); test( - 'it produces configuration with Dart SDK path according to the configuration file', - () { - expect(config.dartSdkPath, const Optional(_dartSdkLocation)); - }); + 'it produces configuration with Dart SDK path according to the ' + 'configuration file', + () { + expect(config.dartSdkPath, const Optional(_dartSdkLocation)); + }, + ); }); group('given command line with path to Dart SDK defined', () { final config = factory.createConfiguration( argResults: argParser.parse(['--dartsdk=$_dartSdkLocation2'])); test( - 'it produces configuration with Dart SDK path according to the command line', - () { - expect(config.dartSdkPath, const Optional(_dartSdkLocation2)); - }); + 'it produces configuration with Dart SDK path according to ' + 'the command line', + () { + expect(config.dartSdkPath, const Optional(_dartSdkLocation2)); + }, + ); }); }); @@ -129,10 +141,12 @@ void main() { final config = factory.createConfiguration(argResults: argParser.parse([])); test( - 'it produces configuration with Flutter SDK path according to the configuration file', - () { - expect(config.flutterSdkPath, const Optional(_flutterSdkLocation)); - }); + 'it produces configuration with Flutter SDK path according to ' + 'the configuration file', + () { + expect(config.flutterSdkPath, const Optional(_flutterSdkLocation)); + }, + ); }); group('given command line with path to Flutter SDK defined', () { @@ -140,10 +154,12 @@ void main() { argResults: argParser.parse(['--fluttersdk=$_flutterSdkLocation2'])); test( - 'it produces configuration with Flutter SDK path according to the command line', - () { - expect(config.flutterSdkPath, const Optional(_flutterSdkLocation2)); - }); + 'it produces configuration with Flutter SDK path according to ' + 'the command line', + () { + expect(config.flutterSdkPath, const Optional(_flutterSdkLocation2)); + }, + ); }); }); diff --git a/test/configuration/creation_without_configuration_file_test.dart b/test/configuration/creation_without_configuration_file_test.dart index f09055f..0f0f458 100644 --- a/test/configuration/creation_without_configuration_file_test.dart +++ b/test/configuration/creation_without_configuration_file_test.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/test/context/borg_boot_context_serialization_test.dart b/test/context/borg_boot_context_serialization_test.dart index 4e75bac..67caa32 100644 --- a/test/context/borg_boot_context_serialization_test.dart +++ b/test/context/borg_boot_context_serialization_test.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -65,7 +65,7 @@ void main() { }); group('given context object without boot context', () { - const context = BorgContext(bootContext: Optional.none()); + const context = BorgContext(); test('it saves content to a file', () { var savedToFile = false; @@ -290,32 +290,39 @@ void main() { group('handling of modified packages', () { group( - 'given context file with boot context not containing list of modified packages', - () { - final factory = BorgContextFactory( - tryToReadFileSync: (_) => - const Optional(contextWithBootContextWithGitrefOnly), - ); - final context = factory.createBorgContext(); - - test('it provides an empty list of modified packages', () { - expect(context.bootContext.unsafe.modifiedPackages, isEmpty); - }); - }); + 'given context file with boot context not containing list of ' + 'modified packages', + () { + final factory = BorgContextFactory( + tryToReadFileSync: (_) => + const Optional(contextWithBootContextWithGitrefOnly), + ); + final context = factory.createBorgContext(); + + test('it provides an empty list of modified packages', () { + expect(context.bootContext.unsafe.modifiedPackages, isEmpty); + }); + }, + ); group( - 'given context file with boot context containing list of modified packages', - () { - final factory = BorgContextFactory( - tryToReadFileSync: (_) => - const Optional(contextWithBootContextWithModifiedPackages), - ); - final context = factory.createBorgContext(); - - test('it provides correct list of modified packages', () { - expect(context.bootContext.unsafe.modifiedPackages, ['a', 'b', 'c']); - }); - }); + 'given context file with boot context containing list of ' + 'modified packages', + () { + final factory = BorgContextFactory( + tryToReadFileSync: (_) => + const Optional(contextWithBootContextWithModifiedPackages), + ); + final context = factory.createBorgContext(); + + test('it provides correct list of modified packages', () { + expect( + context.bootContext.unsafe.modifiedPackages, + ['a', 'b', 'c'], + ); + }); + }, + ); group('given context object with empty list of modified packages', () { const context = BorgContext( diff --git a/test/copy_with_package_dependencies_from_reference_test.dart b/test/copy_with_package_dependencies_from_reference_test.dart index 5d50967..5e6109e 100644 --- a/test/copy_with_package_dependencies_from_reference_test.dart +++ b/test/copy_with_package_dependencies_from_reference_test.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -48,14 +48,17 @@ void main() { }); group( - 'provided with matching hosted reference with different dependency type', - () { - final r = copyWithPackageDependenciesFromReference( - [directHostedXv1], [transitiveHostedXv2]); - test('it corrects the reference without modifying dependency type', () { - expect(r, [directHostedXv2]); - }); - }); + 'provided with matching hosted reference with different dependency type', + () { + final r = copyWithPackageDependenciesFromReference( + [directHostedXv1], + [transitiveHostedXv2], + ); + test('it corrects the reference without modifying dependency type', () { + expect(r, [directHostedXv2]); + }); + }, + ); group('provided with matching sdk reference with different dependency type', () { diff --git a/test/dart_package/dart_package_test.dart b/test/dart_package/dart_package_test.dart index 88fbd9a..f3a2032 100644 --- a/test/dart_package/dart_package_test.dart +++ b/test/dart_package/dart_package_test.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/test/dependency_test_dataset.dart b/test/dependency_test_dataset.dart index b4a878e..34dddb0 100644 --- a/test/dependency_test_dataset.dart +++ b/test/dependency_test_dataset.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/test/find_inconsistent_dependencies_test.dart b/test/find_inconsistent_dependencies_test.dart index 0982848..d149329 100644 --- a/test/find_inconsistent_dependencies_test.dart +++ b/test/find_inconsistent_dependencies_test.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -89,16 +89,18 @@ void main() { }); group( - 'when provided with two dependencies with difference in dependency type only', - () { - final report = findInconsistentDependencies({ - 'a1': const PubspecLock(packages: [_hostedDependencyAv1]), - 'a2': const PubspecLock(packages: [_hostedDependencyAv1Transitive]), - }); - test('it provides empty report', () { - expect(report, isEmpty); - }); - }); + 'when provided with two dependencies with difference in ' + 'dependency type only', + () { + final report = findInconsistentDependencies({ + 'a1': const PubspecLock(packages: [_hostedDependencyAv1]), + 'a2': const PubspecLock(packages: [_hostedDependencyAv1Transitive]), + }); + test('it provides empty report', () { + expect(report, isEmpty); + }); + }, + ); } const _hostedDependencyAv1 = PackageDependency.hosted(HostedPackageDependency( diff --git a/test/find_inconsistent_dependency_specs_test.dart b/test/find_inconsistent_dependency_specs_test.dart index 34b50aa..21ac1b5 100644 --- a/test/find_inconsistent_dependency_specs_test.dart +++ b/test/find_inconsistent_dependency_specs_test.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -79,80 +79,106 @@ void main() { }); group( - 'given two pubspec.yaml files with inconsistent dependency and dev_dependency specs', - () { - final pubspecYamlWithDep = - PubspecYaml.loadFromYamlString('dependencies: {a: ^1.0.0}'); - final pubspecYamlWithDevDep = - PubspecYaml.loadFromYamlString('dev_dependencies: {a: ^2.0.0}'); - final report = findInconsistentDependencySpecs( - {'x': pubspecYamlWithDep, 'y': pubspecYamlWithDevDep}); - test('it produces correct report', () { - expect(report, [ - DependencyUsageReport( - dependencyName: 'a', - references: { - pubspecYamlWithDep.dependencies.first: const ['x'], - pubspecYamlWithDevDep.devDependencies.first: const ['y'], - }, - ) - ]); - }); - }); + 'given two pubspec.yaml files with inconsistent dependency and ' + 'dev_dependency specs', + () { + final pubspecYamlWithDep = PubspecYaml.loadFromYamlString( + 'dependencies: {a: ^1.0.0}', + ); + final pubspecYamlWithDevDep = PubspecYaml.loadFromYamlString( + 'dev_dependencies: {a: ^2.0.0}', + ); + final report = findInconsistentDependencySpecs( + {'x': pubspecYamlWithDep, 'y': pubspecYamlWithDevDep}, + ); + test('it produces correct report', () { + expect(report, [ + DependencyUsageReport( + dependencyName: 'a', + references: { + pubspecYamlWithDep.dependencies.first: const ['x'], + pubspecYamlWithDevDep.devDependencies.first: const ['y'], + }, + ) + ]); + }); + }, + ); group( - 'given two pubspec.yaml files with consistency enforced with dependency override', - () { - final pubspecYaml = PubspecYaml.loadFromYamlString('dependencies: {a:}'); - final pubspecYamlWithOverride = - PubspecYaml.loadFromYamlString('dev_dependencies: {a: ^1.0.0}\n' - 'dependency_overrides: {a: ^2.0.0}'); - final report = findInconsistentDependencySpecs( - {'x': pubspecYaml, 'y': pubspecYamlWithOverride}); - test('it produces empty report', () { - expect(report, isEmpty); - }); - }); + 'given two pubspec.yaml files with consistency enforced with ' + 'dependency override', + () { + final pubspecYaml = PubspecYaml.loadFromYamlString( + 'dependencies: {a:}', + ); + final pubspecYamlWithOverride = PubspecYaml.loadFromYamlString( + 'dev_dependencies: {a: ^1.0.0}\n' + 'dependency_overrides: {a: ^2.0.0}', + ); + final report = findInconsistentDependencySpecs( + {'x': pubspecYaml, 'y': pubspecYamlWithOverride}, + ); + test('it produces empty report', () { + expect(report, isEmpty); + }); + }, + ); group( - 'given two pubspec.yaml files with path dependency with different paths', - () { - final pubspecYaml = - PubspecYaml.loadFromYamlString('dependencies: {a: {path: x}}'); - final anotherPubspecYaml = - PubspecYaml.loadFromYamlString('dependencies: {a: {path: xx}}'); - final report = findInconsistentDependencySpecs( - {'x': pubspecYaml, 'y': anotherPubspecYaml}); - test('it produces empty report', () { - expect(report, isEmpty); - }); - }); + 'given two pubspec.yaml files with path dependency with different paths', + () { + final pubspecYaml = PubspecYaml.loadFromYamlString( + 'dependencies: {a: {path: x}}', + ); + final anotherPubspecYaml = PubspecYaml.loadFromYamlString( + 'dependencies: {a: {path: xx}}', + ); + final report = findInconsistentDependencySpecs( + {'x': pubspecYaml, 'y': anotherPubspecYaml}, + ); + test('it produces empty report', () { + expect(report, isEmpty); + }); + }, + ); group( - 'given two pubspec.yaml files with hosted dependency with version specified and ommitted', - () { - final pubspecYamlNoVersion = - PubspecYaml.loadFromYamlString('dependencies: {a:}'); - final pubspecYamlWithVersion = - PubspecYaml.loadFromYamlString('dependencies: {a: 1.0.0}'); - final report = findInconsistentDependencySpecs( - {'x': pubspecYamlNoVersion, 'y': pubspecYamlWithVersion}); - test('it produces empty report', () { - expect(report, isEmpty); - }); - }); + 'given two pubspec.yaml files with hosted dependency with ' + 'version specified and ommitted', + () { + final pubspecYamlNoVersion = PubspecYaml.loadFromYamlString( + 'dependencies: {a:}', + ); + final pubspecYamlWithVersion = PubspecYaml.loadFromYamlString( + 'dependencies: {a: 1.0.0}', + ); + final report = findInconsistentDependencySpecs( + {'x': pubspecYamlNoVersion, 'y': pubspecYamlWithVersion}, + ); + test('it produces empty report', () { + expect(report, isEmpty); + }); + }, + ); group( - 'given two pubspec.yaml files with hosted dependency ommitted version specifications', - () { - final pubspecYaml = PubspecYaml.loadFromYamlString('dependencies: {a:}'); - final anotherpubspecYaml = - PubspecYaml.loadFromYamlString('dependencies: {a:}'); - final report = findInconsistentDependencySpecs( - {'x': pubspecYaml, 'y': anotherpubspecYaml}); - test('it produces empty report', () { - expect(report, isEmpty); - }); - }); + 'given two pubspec.yaml files with ' + 'hosted dependency ommitted version specifications', + () { + final pubspecYaml = PubspecYaml.loadFromYamlString( + 'dependencies: {a:}', + ); + final anotherpubspecYaml = PubspecYaml.loadFromYamlString( + 'dependencies: {a:}', + ); + final report = findInconsistentDependencySpecs( + {'x': pubspecYaml, 'y': anotherpubspecYaml}, + ); + test('it produces empty report', () { + expect(report, isEmpty); + }); + }, + ); }); } diff --git a/test/get_all_external_package_dependency_specs_test.dart b/test/get_all_external_package_dependency_specs_test.dart index 0c334d9..0f66ed9 100644 --- a/test/get_all_external_package_dependency_specs_test.dart +++ b/test/get_all_external_package_dependency_specs_test.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -86,19 +86,22 @@ void main() { }); group( - 'provided with pubspec.yaml with a single development hosted dependency', - () { - final pubspecYaml = - PubspecYaml.loadFromYamlString('dev_dependencies: {a: }'); - final r = getAllExternalPackageDependencySpecs([pubspecYaml]); + 'provided with pubspec.yaml with a single development hosted dependency', + () { + final pubspecYaml = PubspecYaml.loadFromYamlString( + 'dev_dependencies: {a: }', + ); + final r = getAllExternalPackageDependencySpecs([pubspecYaml]); - test('it produces the specified dependency', () { - expect(r, const [ - PackageDependencySpec.hosted( - HostedPackageDependencySpec(package: 'a')) - ]); - }); - }); + test('it produces the specified dependency', () { + expect(r, const [ + PackageDependencySpec.hosted( + HostedPackageDependencySpec(package: 'a'), + ) + ]); + }); + }, + ); group('provided with pubspec.yaml with a dependency override', () { const overridenVersion = '^2.0.0'; @@ -118,23 +121,31 @@ void main() { }); group( - 'given two pubspec.yaml files with hosted dependency with version specified and ommitted', - () { - final pubspecYamlNoVersion = - PubspecYaml.loadFromYamlString('dependencies: {a:}'); - final pubspecYamlWithVersion = - PubspecYaml.loadFromYamlString('dependencies: {a: 1.0.0}'); - final r = getAllExternalPackageDependencySpecs( - [pubspecYamlNoVersion, pubspecYamlWithVersion]); + 'given two pubspec.yaml files with hosted dependency with ' + 'version specified and ommitted', + () { + final pubspecYamlNoVersion = PubspecYaml.loadFromYamlString( + 'dependencies: {a:}', + ); + final pubspecYamlWithVersion = PubspecYaml.loadFromYamlString( + 'dependencies: {a: 1.0.0}', + ); + final r = getAllExternalPackageDependencySpecs( + [pubspecYamlNoVersion, pubspecYamlWithVersion], + ); - test('it produces dependency with detailed specification', () { - expect(r, const [ - PackageDependencySpec.hosted(HostedPackageDependencySpec( - package: 'a', - version: Optional('1.0.0'), - )) - ]); - }); - }); + test('it produces dependency with detailed specification', () { + expect( + r, + const [ + PackageDependencySpec.hosted(HostedPackageDependencySpec( + package: 'a', + version: Optional('1.0.0'), + )) + ], + ); + }); + }, + ); }); } diff --git a/test/impact/impact_based_on_pubspec_yaml_test.dart b/test/impact/impact_based_on_pubspec_yaml_test.dart index 62d2875..872a653 100644 --- a/test/impact/impact_based_on_pubspec_yaml_test.dart +++ b/test/impact/impact_based_on_pubspec_yaml_test.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -74,42 +74,50 @@ void main() { }); group( - 'given input with packages, first directly dev depends on the second, third depends on the second', - () { - final packagesUnderImpact = impactBasedOnPubspecYaml( - packages: [_packageA], - allPackagesInScope: [_packageA, _packageE, _packageF], - ); - test( - 'it returns the list containing only the first and the second packages', + 'given input with packages, first directly dev depends on the second, ' + 'third depends on the second', + () { + final packagesUnderImpact = impactBasedOnPubspecYaml( + packages: [_packageA], + allPackagesInScope: [_packageA, _packageE, _packageF], + ); + test( + 'it returns the list containing only ' + 'the first and the second packages', () { - expect(packagesUnderImpact, {_packageA, _packageE}); - }); - }); + expect(packagesUnderImpact, {_packageA, _packageE}); + }, + ); + }, + ); group( - 'given input with packages, one directly depends on another via dependency override', - () { - final packagesUnderImpact = impactBasedOnPubspecYaml( - packages: [_packageA], - allPackagesInScope: [_packageA, _packageG], - ); - test('it returns the list containing both packages', () { - expect(packagesUnderImpact, {_packageA, _packageG}); - }); - }); + 'given input with packages, ' + 'one directly depends on another via dependency override', + () { + final packagesUnderImpact = impactBasedOnPubspecYaml( + packages: [_packageA], + allPackagesInScope: [_packageA, _packageG], + ); + test('it returns the list containing both packages', () { + expect(packagesUnderImpact, {_packageA, _packageG}); + }); + }, + ); group( - 'given input with packages, one directly dev depends on another via dependency override', - () { - final packagesUnderImpact = impactBasedOnPubspecYaml( - packages: [_packageA], - allPackagesInScope: [_packageA, _packageH], - ); - test('it returns the list containing both packages', () { - expect(packagesUnderImpact, {_packageA, _packageH}); - }); - }); + 'given input with packages, ' + 'one directly dev depends on another via dependency override', + () { + final packagesUnderImpact = impactBasedOnPubspecYaml( + packages: [_packageA], + allPackagesInScope: [_packageA, _packageH], + ); + test('it returns the list containing both packages', () { + expect(packagesUnderImpact, {_packageA, _packageH}); + }); + }, + ); group('given input with a package dependent on a package out of scope', () { final packagesUnderImpact = impactBasedOnPubspecYaml( diff --git a/test/utils/lazy_data_test.dart b/test/utils/lazy_data_test.dart index 145838b..7b4d452 100644 --- a/test/utils/lazy_data_test.dart +++ b/test/utils/lazy_data_test.dart @@ -10,8 +10,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,