diff --git a/CHANGELOG.md b/CHANGELOG.md index a3c0d4c..9fd230d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## 2.0.1-dev + ## 2.0.0 - Require Dart `2.12.0`. diff --git a/analysis_options.yaml b/analysis_options.yaml index 3cf9c19..cf427a8 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,4 +1,4 @@ -include: package:pedantic/analysis_options.yaml +include: package:lints/recommended.yaml analyzer: strong-mode: @@ -6,72 +6,46 @@ analyzer: linter: rules: + - always_declare_return_types - avoid_catching_errors - avoid_dynamic_calls - - avoid_function_literals_in_foreach_calls - avoid_private_typedef_functions - avoid_redundant_argument_values - - avoid_renaming_method_parameters - avoid_returning_null - avoid_returning_null_for_future - - avoid_returning_null_for_void - avoid_unused_constructor_parameters - avoid_void_async - - await_only_futures - - camel_case_types - cancel_subscriptions - cascade_invocations - comment_references - - constant_identifier_names - - control_flow_in_finally - directives_ordering - - empty_statements - - file_names - - hash_and_equals - - implementation_imports - invariant_booleans - - iterable_contains_unrelated_type - join_return_with_assignment - lines_longer_than_80_chars - - list_remove_unrelated_type - literal_only_boolean_expressions - missing_whitespace_between_adjacent_strings - no_adjacent_strings_in_list - no_runtimeType_toString - - non_constant_identifier_names + - omit_local_variable_types - only_throw_errors - - overridden_fields - package_api_docs - - package_names - - package_prefixed_library_names - prefer_asserts_in_initializer_lists - prefer_const_constructors - prefer_const_declarations - prefer_expression_function_bodies - prefer_final_locals - - prefer_function_declarations_over_variables - - prefer_initializing_formals - - prefer_inlined_adds - prefer_interpolation_to_compose_strings - - prefer_is_not_operator - - prefer_null_aware_operators - prefer_relative_imports - - prefer_typing_uninitialized_variables - - prefer_void_to_null - - provide_deprecation_message + - prefer_single_quotes - sort_pub_dependencies - test_types_in_equals - throw_in_finally - type_annotate_public_apis + - unawaited_futures - unnecessary_await_in_return - - unnecessary_brace_in_string_interps - - unnecessary_getters_setters - unnecessary_lambdas - unnecessary_null_aware_assignments - - unnecessary_overrides - unnecessary_parenthesis - unnecessary_statements - - unnecessary_string_interpolations - use_is_even_rather_than_modulo - use_string_buffers - - void_checks diff --git a/lib/src/impl.dart b/lib/src/impl.dart index a9160bc..bc373b9 100644 --- a/lib/src/impl.dart +++ b/lib/src/impl.dart @@ -1,4 +1,3 @@ -import 'dart:convert'; import 'dart:io'; import 'package:path/path.dart' as p; @@ -26,7 +25,11 @@ void expectBuildCleanImpl( } // 1 - get a list of modified files files - should be empty - expect(_changedGeneratedFiles(workingDir), isEmpty); + expect( + _changedGeneratedFiles(workingDir), + isEmpty, + reason: 'The working directory should be clean before running build.', + ); var executable = command.first; if (executable == pubPlaceHolder) { @@ -51,16 +54,8 @@ void expectResultOutputSucceeds(String result) { contains(RegExp(r'\[INFO\] Succeeded after .+ with \d+ outputs'))); } -final _whitespace = RegExp(r'\s'); - -Set _changedGeneratedFiles(String workingDir) { - final output = _runProc('git', ['status', '--porcelain'], workingDir); - - return LineSplitter.split(output) - .map((line) => line.split(_whitespace).last) - .where((path) => path.endsWith('.dart')) - .toSet(); -} +String _changedGeneratedFiles(String workingDir) => + _runProc('git', ['diff'], workingDir); String _runProc(String proc, List args, String workingDir) { final result = Process.runSync(proc, args, workingDirectory: workingDir); diff --git a/lib/src/version.dart b/lib/src/version.dart index 0e58df3..3bb9e67 100644 --- a/lib/src/version.dart +++ b/lib/src/version.dart @@ -1,2 +1,2 @@ // Generated code. Do not modify. -const packageVersion = '2.0.0'; +const packageVersion = '2.0.1-dev'; diff --git a/pubspec.yaml b/pubspec.yaml index e66a9bc..58f20c6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: build_verify description: >- Test utility to ensure generated Dart code within a package is up-to-date when using package:build. -version: 2.0.0 +version: 2.0.1-dev repository: https://github.com/kevmoo/build_verify environment: @@ -17,6 +17,6 @@ dev_dependencies: build_runner: ^2.0.0 build_version: ^2.0.0 git: ^2.0.0 - pedantic: ^1.1.0 + lints: ^1.0.0 test_descriptor: ^2.0.0 test_process: ^2.0.0