From 9b1a35f70b3044df13d816db5b19b4b06039374c Mon Sep 17 00:00:00 2001 From: evanweible-wf Date: Tue, 31 Jul 2018 13:13:40 -0600 Subject: [PATCH 1/2] Dart 2 compatibility --- .travis.yml | 7 +- lib/src/utils.dart | 4 +- pubspec.yaml | 11 +- test/{unit => }/executable_test.dart | 0 test/generated_runner.dart | 13 -- test/{unit/src => }/utils_test.dart | 0 test_fixtures/analyzer/pubspec.lock | 91 +++++---- test_fixtures/dependency_pins/pubspec.lock | 67 ++++--- test_fixtures/dependency_pins/pubspec.yaml | 2 +- test_fixtures/missing/pubspec.lock | 34 ++-- test_fixtures/over_promoted/pubspec.lock | 34 ++-- test_fixtures/under_promoted/pubspec.lock | 34 ++-- test_fixtures/unused/pubspec.lock | 104 +++++++---- test_fixtures/valid/lib/valid.dart | 2 +- test_fixtures/valid/pubspec.lock | 204 ++++++++++++++------- test_fixtures/valid/tool/dev.dart | 2 +- tool/dev.dart | 31 ---- tool/test.sh | 15 ++ 18 files changed, 399 insertions(+), 256 deletions(-) rename test/{unit => }/executable_test.dart (100%) delete mode 100644 test/generated_runner.dart rename test/{unit/src => }/utils_test.dart (100%) create mode 100755 tool/test.sh diff --git a/.travis.yml b/.travis.yml index 7285b81..1e8028c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,14 @@ language: dart dart: - - stable + - 1.24.3 - dev script: - - pub run dart_dev task-runner + - dartanalyzer . + - pub run dart_style:format -l 120 -n . + - pub run dependency_validator -i build_runner,build_test,coverage,dartdoc,dart_style,_foo,foo,_bar,bar,foo1,foo_foo + - ./tool/test.sh cache: directories: diff --git a/lib/src/utils.dart b/lib/src/utils.dart index cb38f9d..15cfdbf 100644 --- a/lib/src/utils.dart +++ b/lib/src/utils.dart @@ -47,14 +47,14 @@ Iterable listScssFilesIn(String dirPath, List excludedDirs) => Iterable listFilesWithExtensionIn(String dirPath, List excludedDirs, String extension) { if (!FileSystemEntity.isDirectorySync(dirPath)) return const []; - return new Directory(dirPath).listSync(recursive: true).where((entity) { + return new List.from(new Directory(dirPath).listSync(recursive: true).where((entity) { if (entity is! File) return false; if (p.split(entity.path).contains('packages')) return false; if (p.extension(entity.path) != ('.$extension')) return false; if (excludedDirs.any((dir) => p.isWithin(dir, entity.path))) return false; return true; - }); + })); } /// Logs a warning with the given [infraction] and lists all of the given diff --git a/pubspec.yaml b/pubspec.yaml index dfabcc4..5a48891 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -7,7 +7,7 @@ authors: - Evan Weible environment: - sdk: ">=1.24.2 <2.0.0" + sdk: '>=1.24.2 <3.0.0' dependencies: args: '>=0.13.7 <2.0.0' @@ -17,11 +17,12 @@ dependencies: yaml: ^2.1.13 dev_dependencies: - coverage: '>=0.9.3 <0.11.0' - dartdoc: '>=0.14.1 <0.19.0' - dart_dev: ^1.8.0 + build_runner: '>=0.6.0 <1.0.0' + build_test: '>=0.9.0 <1.0.0' + coverage: '>=0.9.3 <0.13.0' + dart_dev: ^1.9.5 dart_style: ^1.0.8 - test: ^0.12.24+8 + test: ^0.12.30 executables: dependency_validator: diff --git a/test/unit/executable_test.dart b/test/executable_test.dart similarity index 100% rename from test/unit/executable_test.dart rename to test/executable_test.dart diff --git a/test/generated_runner.dart b/test/generated_runner.dart deleted file mode 100644 index ae8d999..0000000 --- a/test/generated_runner.dart +++ /dev/null @@ -1,13 +0,0 @@ -@TestOn('vm') -library test.generated_runner; - -// Generated by `pub run dart_dev gen-test-runner -d test -e Environment.vm --no-genHtml` - -import './unit/executable_test.dart' as unit_executable_test; -import './unit/src/utils_test.dart' as unit_src_utils_test; -import 'package:test/test.dart'; - -void main() { - unit_executable_test.main(); - unit_src_utils_test.main(); -} diff --git a/test/unit/src/utils_test.dart b/test/utils_test.dart similarity index 100% rename from test/unit/src/utils_test.dart rename to test/utils_test.dart diff --git a/test_fixtures/analyzer/pubspec.lock b/test_fixtures/analyzer/pubspec.lock index 8c1023b..9dc276d 100644 --- a/test_fixtures/analyzer/pubspec.lock +++ b/test_fixtures/analyzer/pubspec.lock @@ -1,167 +1,180 @@ # Generated by pub -# See http://pub.dartlang.org/doc/glossary.html#lockfile +# See https://www.dartlang.org/tools/pub/glossary#lockfile packages: analyzer: + dependency: "direct main" description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "0.30.0+4" + version: "0.32.4" args: + dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "1.4.3" + version: "1.4.4" async: + dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.8" charcode: + dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" - cli_util: - description: - name: cli_util - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.2+1" + version: "1.1.2" collection: + dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.6" + version: "1.14.11" convert: + dependency: transitive description: name: convert url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.2" crypto: + dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "2.0.2+1" + version: "2.0.6" csslib: + dependency: transitive description: name: csslib url: "https://pub.dartlang.org" source: hosted - version: "0.14.3" + version: "0.14.4+1" dependency_validator: + dependency: "direct dev" description: path: "../.." relative: true source: path - version: "1.1.2" + version: "1.2.0" front_end: + dependency: transitive description: name: front_end url: "https://pub.dartlang.org" source: hosted - version: "0.1.0-alpha.4.1" + version: "0.1.4" glob: + dependency: transitive description: name: glob url: "https://pub.dartlang.org" source: hosted - version: "1.1.5" + version: "1.1.7" html: + dependency: transitive description: name: html url: "https://pub.dartlang.org" source: hosted - version: "0.13.3" - isolate: - description: - name: isolate - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" + version: "0.13.3+2" kernel: + dependency: transitive description: name: kernel url: "https://pub.dartlang.org" source: hosted - version: "0.3.0-alpha.1.1" + version: "0.3.4" logging: + dependency: transitive description: name: logging url: "https://pub.dartlang.org" source: hosted - version: "0.11.3+1" + version: "0.11.3+2" meta: + dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.1.5" + version: "1.1.6" package_config: + dependency: transitive description: name: package_config url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.0.5" path: + dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.5.1" + version: "1.6.2" plugin: + dependency: transitive description: name: plugin url: "https://pub.dartlang.org" source: hosted - version: "0.2.0+2" + version: "0.2.0+3" pub_semver: + dependency: transitive description: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "1.4.1" + version: "1.4.2" source_span: + dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.4.0" + version: "1.4.1" string_scanner: + dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "1.0.3" typed_data: + dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.1.5" + version: "1.1.6" utf: + dependency: transitive description: name: utf url: "https://pub.dartlang.org" source: hosted - version: "0.9.0+3" + version: "0.9.0+5" watcher: + dependency: transitive description: name: watcher url: "https://pub.dartlang.org" source: hosted - version: "0.9.7+6" + version: "0.9.7+10" yaml: + dependency: transitive description: name: yaml url: "https://pub.dartlang.org" source: hosted - version: "2.1.13" + version: "2.1.15" sdks: - dart: ">=1.24.2 <2.0.0" + dart: ">=2.0.0-dev.62.0 <3.0.0" diff --git a/test_fixtures/dependency_pins/pubspec.lock b/test_fixtures/dependency_pins/pubspec.lock index f72800e..4c4c331 100644 --- a/test_fixtures/dependency_pins/pubspec.lock +++ b/test_fixtures/dependency_pins/pubspec.lock @@ -1,131 +1,152 @@ # Generated by pub -# See http://pub.dartlang.org/doc/glossary.html#lockfile +# See https://www.dartlang.org/tools/pub/glossary#lockfile packages: args: + dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "0.13.7" + version: "1.4.4" async: + dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.8" charcode: + dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.1.2" collection: + dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.6" + version: "1.14.11" convert: + dependency: transitive description: name: convert url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.2" coverage: + dependency: "direct dev" description: name: coverage url: "https://pub.dartlang.org" source: hosted - version: "0.9.3" + version: "0.12.2" crypto: + dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "2.0.2+1" + version: "2.0.6" dependency_validator: + dependency: "direct dev" description: path: "../.." relative: true source: path - version: "1.1.2" + version: "1.2.0" json_rpc_2: + dependency: transitive description: name: json_rpc_2 url: "https://pub.dartlang.org" source: hosted - version: "2.0.7" + version: "2.0.9" logging: + dependency: transitive description: name: logging url: "https://pub.dartlang.org" source: hosted - version: "0.11.3+1" + version: "0.11.3+2" package_config: + dependency: transitive description: name: package_config url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.0.5" path: + dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.5.1" + version: "1.6.2" pub_semver: + dependency: transitive description: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "1.4.1" + version: "1.4.2" source_span: + dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.4.0" + version: "1.4.1" stack_trace: + dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.9.2" + version: "1.9.3" stream_channel: + dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "1.6.6" + version: "1.6.8" string_scanner: + dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "1.0.3" typed_data: + dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.1.5" + version: "1.1.6" vm_service_client: + dependency: transitive description: name: vm_service_client url: "https://pub.dartlang.org" source: hosted - version: "0.2.4" + version: "0.2.6" web_socket_channel: + dependency: transitive description: name: web_socket_channel url: "https://pub.dartlang.org" source: hosted - version: "1.0.6" + version: "1.0.9" yaml: + dependency: transitive description: name: yaml url: "https://pub.dartlang.org" source: hosted - version: "2.1.13" + version: "2.1.15" sdks: - dart: ">=1.24.2 <2.0.0" + dart: ">=2.0.0-dev.64.1 <3.0.0" diff --git a/test_fixtures/dependency_pins/pubspec.yaml b/test_fixtures/dependency_pins/pubspec.yaml index 5dd43b4..2d59f9e 100644 --- a/test_fixtures/dependency_pins/pubspec.yaml +++ b/test_fixtures/dependency_pins/pubspec.yaml @@ -3,6 +3,6 @@ version: 0.0.0 private: true dev_dependencies: - coverage: '>=0.9.3 <=0.11.0' + coverage: '>=0.9.3 <=0.13.0' dependency_validator: path: ../.. diff --git a/test_fixtures/missing/pubspec.lock b/test_fixtures/missing/pubspec.lock index 5af27c4..cd6b1cb 100644 --- a/test_fixtures/missing/pubspec.lock +++ b/test_fixtures/missing/pubspec.lock @@ -1,65 +1,75 @@ # Generated by pub -# See http://pub.dartlang.org/doc/glossary.html#lockfile +# See https://www.dartlang.org/tools/pub/glossary#lockfile packages: args: + dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "1.4.3" + version: "1.4.4" charcode: + dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.1.2" collection: + dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.6" + version: "1.14.11" dependency_validator: + dependency: "direct dev" description: path: "../.." relative: true source: path - version: "1.1.2" + version: "1.2.0" logging: + dependency: transitive description: name: logging url: "https://pub.dartlang.org" source: hosted - version: "0.11.3+1" + version: "0.11.3+2" path: + dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.5.1" + version: "1.6.2" pub_semver: + dependency: transitive description: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "1.4.1" + version: "1.4.2" source_span: + dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.4.0" + version: "1.4.1" string_scanner: + dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "1.0.3" yaml: + dependency: transitive description: name: yaml url: "https://pub.dartlang.org" source: hosted - version: "2.1.13" + version: "2.1.15" sdks: - dart: ">=1.24.2 <2.0.0" + dart: ">=2.0.0-dev.62.0 <3.0.0" diff --git a/test_fixtures/over_promoted/pubspec.lock b/test_fixtures/over_promoted/pubspec.lock index 5af27c4..219cde4 100644 --- a/test_fixtures/over_promoted/pubspec.lock +++ b/test_fixtures/over_promoted/pubspec.lock @@ -1,65 +1,75 @@ # Generated by pub -# See http://pub.dartlang.org/doc/glossary.html#lockfile +# See https://www.dartlang.org/tools/pub/glossary#lockfile packages: args: + dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "1.4.3" + version: "1.4.4" charcode: + dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.1.2" collection: + dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.6" + version: "1.14.11" dependency_validator: + dependency: "direct dev" description: path: "../.." relative: true source: path - version: "1.1.2" + version: "1.2.0" logging: + dependency: transitive description: name: logging url: "https://pub.dartlang.org" source: hosted - version: "0.11.3+1" + version: "0.11.3+2" path: + dependency: "direct main" description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.5.1" + version: "1.6.2" pub_semver: + dependency: transitive description: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "1.4.1" + version: "1.4.2" source_span: + dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.4.0" + version: "1.4.1" string_scanner: + dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "1.0.3" yaml: + dependency: "direct main" description: name: yaml url: "https://pub.dartlang.org" source: hosted - version: "2.1.13" + version: "2.1.15" sdks: - dart: ">=1.24.2 <2.0.0" + dart: ">=2.0.0-dev.62.0 <3.0.0" diff --git a/test_fixtures/under_promoted/pubspec.lock b/test_fixtures/under_promoted/pubspec.lock index 5af27c4..5cac5fb 100644 --- a/test_fixtures/under_promoted/pubspec.lock +++ b/test_fixtures/under_promoted/pubspec.lock @@ -1,65 +1,75 @@ # Generated by pub -# See http://pub.dartlang.org/doc/glossary.html#lockfile +# See https://www.dartlang.org/tools/pub/glossary#lockfile packages: args: + dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "1.4.3" + version: "1.4.4" charcode: + dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.1.2" collection: + dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.6" + version: "1.14.11" dependency_validator: + dependency: "direct dev" description: path: "../.." relative: true source: path - version: "1.1.2" + version: "1.2.0" logging: + dependency: "direct dev" description: name: logging url: "https://pub.dartlang.org" source: hosted - version: "0.11.3+1" + version: "0.11.3+2" path: + dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.5.1" + version: "1.6.2" pub_semver: + dependency: transitive description: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "1.4.1" + version: "1.4.2" source_span: + dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.4.0" + version: "1.4.1" string_scanner: + dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "1.0.3" yaml: + dependency: "direct dev" description: name: yaml url: "https://pub.dartlang.org" source: hosted - version: "2.1.13" + version: "2.1.15" sdks: - dart: ">=1.24.2 <2.0.0" + dart: ">=2.0.0-dev.62.0 <3.0.0" diff --git a/test_fixtures/unused/pubspec.lock b/test_fixtures/unused/pubspec.lock index f54fad1..f142112 100644 --- a/test_fixtures/unused/pubspec.lock +++ b/test_fixtures/unused/pubspec.lock @@ -1,233 +1,271 @@ # Generated by pub -# See http://pub.dartlang.org/doc/glossary.html#lockfile +# See https://www.dartlang.org/tools/pub/glossary#lockfile packages: ansicolor: + dependency: transitive description: name: ansicolor url: "https://pub.dartlang.org" source: hosted - version: "0.0.9" + version: "0.0.10" archive: + dependency: transitive description: name: archive url: "https://pub.dartlang.org" source: hosted version: "1.0.33" args: + dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "1.4.3" + version: "1.4.4" async: + dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "1.13.3" + version: "2.0.8" barback: + dependency: transitive description: name: barback url: "https://pub.dartlang.org" source: hosted - version: "0.15.2+15" + version: "0.15.2+16" browser: + dependency: transitive description: name: browser url: "https://pub.dartlang.org" source: hosted version: "0.10.0+3" charcode: + dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.1.2" collection: + dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.6" + version: "1.14.11" convert: + dependency: transitive description: name: convert url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.2" crypto: + dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "2.0.2+1" + version: "2.0.6" csslib: + dependency: transitive description: name: csslib url: "https://pub.dartlang.org" source: hosted - version: "0.14.3" + version: "0.14.4+1" dart2_constant: + dependency: transitive description: name: dart2_constant url: "https://pub.dartlang.org" source: hosted - version: "1.0.1+dart1" + version: "1.0.1+dart2" dart_dev: + dependency: "direct dev" description: name: dart_dev url: "https://pub.dartlang.org" source: hosted - version: "1.9.2" + version: "1.9.5" dependency_validator: + dependency: "direct dev" description: path: "../.." relative: true source: path - version: "1.1.2" + version: "1.2.0" fluri: + dependency: transitive description: name: fluri url: "https://pub.dartlang.org" source: hosted version: "1.2.4" html: + dependency: transitive description: name: html url: "https://pub.dartlang.org" source: hosted - version: "0.13.3" + version: "0.13.3+2" http: + dependency: transitive description: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.11.3+16" + version: "0.11.3+17" http_parser: + dependency: transitive description: name: http_parser url: "https://pub.dartlang.org" source: hosted - version: "3.1.2" + version: "3.1.3" logging: + dependency: transitive description: name: logging url: "https://pub.dartlang.org" source: hosted - version: "0.11.3+1" + version: "0.11.3+2" matcher: + dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.2" + version: "0.12.4" meta: + dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.1.5" + version: "1.1.6" path: + dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.5.1" + version: "1.6.2" petitparser: + dependency: transitive description: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "1.7.6" + version: "1.7.7" platform_detect: + dependency: transitive description: name: platform_detect url: "https://pub.dartlang.org" source: hosted version: "1.3.3" pool: + dependency: transitive description: name: pool url: "https://pub.dartlang.org" source: hosted - version: "1.3.4" + version: "1.3.6" pub_semver: + dependency: transitive description: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "1.4.1" + version: "1.4.2" resource: + dependency: transitive description: name: resource url: "https://pub.dartlang.org" source: hosted - version: "2.1.2" + version: "2.1.5" rxdart: + dependency: transitive description: name: rxdart url: "https://pub.dartlang.org" source: hosted - version: "0.15.1" + version: "0.16.7" source_span: + dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.4.0" + version: "1.4.1" stack_trace: + dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.9.2" + version: "1.9.3" string_scanner: + dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "1.0.3" typed_data: + dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.1.5" + version: "1.1.6" unittest: + dependency: transitive description: name: unittest url: "https://pub.dartlang.org" source: hosted version: "0.11.7" utf: + dependency: transitive description: name: utf url: "https://pub.dartlang.org" source: hosted - version: "0.9.0+3" + version: "0.9.0+5" uuid: + dependency: transitive description: name: uuid url: "https://pub.dartlang.org" source: hosted - version: "0.5.3" + version: "1.0.1" webdriver: + dependency: transitive description: name: webdriver url: "https://pub.dartlang.org" source: hosted version: "1.2.3" xml: + dependency: transitive description: name: xml url: "https://pub.dartlang.org" source: hosted version: "2.6.0" yaml: + dependency: transitive description: name: yaml url: "https://pub.dartlang.org" source: hosted - version: "2.1.13" + version: "2.1.15" sdks: - dart: ">=1.24.2 <2.0.0-dev.44" + dart: ">=2.0.0-dev.62.0 <=2.0.0-dev.69.5" diff --git a/test_fixtures/valid/lib/valid.dart b/test_fixtures/valid/lib/valid.dart index ad188ed..645baee 100644 --- a/test_fixtures/valid/lib/valid.dart +++ b/test_fixtures/valid/lib/valid.dart @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:logging/logging.dart'; \ No newline at end of file +import 'package:logging/logging.dart'; diff --git a/test_fixtures/valid/pubspec.lock b/test_fixtures/valid/pubspec.lock index 8a8457c..1bab095 100644 --- a/test_fixtures/valid/pubspec.lock +++ b/test_fixtures/valid/pubspec.lock @@ -1,401 +1,467 @@ # Generated by pub -# See http://pub.dartlang.org/doc/glossary.html#lockfile +# See https://www.dartlang.org/tools/pub/glossary#lockfile packages: analyzer: + dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "0.30.0+4" + version: "0.32.4" ansicolor: + dependency: transitive description: name: ansicolor url: "https://pub.dartlang.org" source: hosted - version: "0.0.9" + version: "0.0.10" archive: + dependency: transitive description: name: archive url: "https://pub.dartlang.org" source: hosted version: "1.0.33" args: + dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "1.4.3" + version: "1.4.4" async: + dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "1.13.3" + version: "2.0.8" barback: + dependency: transitive description: name: barback url: "https://pub.dartlang.org" source: hosted - version: "0.15.2+15" + version: "0.15.2+16" boolean_selector: + dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.0.4" browser: + dependency: transitive description: name: browser url: "https://pub.dartlang.org" source: hosted version: "0.10.0+3" charcode: + dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" - cli_util: - description: - name: cli_util - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.2+1" + version: "1.1.2" collection: + dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.6" + version: "1.14.11" convert: + dependency: transitive description: name: convert url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.2" crypto: + dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "2.0.2+1" + version: "2.0.6" csslib: + dependency: transitive description: name: csslib url: "https://pub.dartlang.org" source: hosted - version: "0.14.3" + version: "0.14.4+1" dart2_constant: + dependency: transitive description: name: dart2_constant url: "https://pub.dartlang.org" source: hosted - version: "1.0.1+dart1" + version: "1.0.1+dart2" dart_dev: + dependency: "direct dev" description: name: dart_dev url: "https://pub.dartlang.org" source: hosted - version: "1.9.2" + version: "1.9.5" dart_to_js_script_rewriter: + dependency: "direct dev" description: name: dart_to_js_script_rewriter url: "https://pub.dartlang.org" source: hosted version: "1.0.3" dependency_validator: + dependency: "direct dev" description: path: "../.." relative: true source: path - version: "1.1.2" + version: "1.2.0" fluri: + dependency: transitive description: name: fluri url: "https://pub.dartlang.org" source: hosted version: "1.2.4" front_end: + dependency: transitive description: name: front_end url: "https://pub.dartlang.org" source: hosted - version: "0.1.0-alpha.4.1" + version: "0.1.4" glob: + dependency: transitive description: name: glob url: "https://pub.dartlang.org" source: hosted - version: "1.1.5" + version: "1.1.7" html: + dependency: transitive description: name: html url: "https://pub.dartlang.org" source: hosted - version: "0.13.3" + version: "0.13.3+2" http: + dependency: transitive description: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.11.3+16" + version: "0.11.3+17" http_multi_server: + dependency: transitive description: name: http_multi_server url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.5" http_parser: + dependency: transitive description: name: http_parser url: "https://pub.dartlang.org" source: hosted - version: "3.1.2" + version: "3.1.3" io: + dependency: transitive description: name: io url: "https://pub.dartlang.org" source: hosted - version: "0.3.2+1" - isolate: + version: "0.3.3" + js: + dependency: transitive description: - name: isolate + name: js url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" - js: + version: "0.6.1+1" + json_rpc_2: + dependency: transitive description: - name: js + name: json_rpc_2 url: "https://pub.dartlang.org" source: hosted - version: "0.6.1" + version: "2.0.9" kernel: + dependency: transitive description: name: kernel url: "https://pub.dartlang.org" source: hosted - version: "0.3.0-alpha.1.1" + version: "0.3.4" logging: + dependency: "direct main" description: name: logging url: "https://pub.dartlang.org" source: hosted - version: "0.11.3+1" + version: "0.11.3+2" matcher: + dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.1+4" + version: "0.12.3+1" meta: + dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.1.5" + version: "1.1.6" mime: + dependency: transitive description: name: mime url: "https://pub.dartlang.org" source: hosted - version: "0.9.5" + version: "0.9.6+2" multi_server_socket: + dependency: transitive description: name: multi_server_socket url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.2" node_preamble: + dependency: transitive description: name: node_preamble url: "https://pub.dartlang.org" source: hosted - version: "1.4.1" + version: "1.4.4" package_config: + dependency: transitive description: name: package_config url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.0.5" package_resolver: + dependency: transitive description: name: package_resolver url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "1.0.4" path: + dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.5.1" + version: "1.6.2" petitparser: + dependency: transitive description: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "1.7.6" + version: "1.7.7" platform_detect: + dependency: transitive description: name: platform_detect url: "https://pub.dartlang.org" source: hosted version: "1.3.3" plugin: + dependency: transitive description: name: plugin url: "https://pub.dartlang.org" source: hosted - version: "0.2.0+2" + version: "0.2.0+3" pool: + dependency: transitive description: name: pool url: "https://pub.dartlang.org" source: hosted - version: "1.3.4" + version: "1.3.6" pub_semver: + dependency: transitive description: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "1.4.1" + version: "1.4.2" resource: + dependency: transitive description: name: resource url: "https://pub.dartlang.org" source: hosted - version: "2.1.2" + version: "2.1.5" rxdart: + dependency: transitive description: name: rxdart url: "https://pub.dartlang.org" source: hosted - version: "0.15.1" + version: "0.16.7" shelf: + dependency: transitive description: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "0.7.3" + version: "0.7.3+3" shelf_packages_handler: + dependency: transitive description: name: shelf_packages_handler url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.0.4" shelf_static: + dependency: transitive description: name: shelf_static url: "https://pub.dartlang.org" source: hosted - version: "0.2.7" + version: "0.2.8" shelf_web_socket: + dependency: transitive description: name: shelf_web_socket url: "https://pub.dartlang.org" source: hosted - version: "0.2.2" + version: "0.2.2+3" source_map_stack_trace: + dependency: transitive description: name: source_map_stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.1.4" + version: "1.1.5" source_maps: + dependency: transitive description: name: source_maps url: "https://pub.dartlang.org" source: hosted - version: "0.10.5" + version: "0.10.7" source_span: + dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.4.0" + version: "1.4.1" stack_trace: + dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.9.2" + version: "1.9.3" stream_channel: + dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "1.6.6" + version: "1.6.8" string_scanner: + dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "1.0.3" term_glyph: + dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.1" test: + dependency: "direct dev" description: name: test url: "https://pub.dartlang.org" source: hosted - version: "0.12.34" + version: "1.3.0" typed_data: + dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.1.5" + version: "1.1.6" unittest: + dependency: transitive description: name: unittest url: "https://pub.dartlang.org" source: hosted version: "0.11.7" utf: + dependency: transitive description: name: utf url: "https://pub.dartlang.org" source: hosted - version: "0.9.0+3" + version: "0.9.0+5" uuid: + dependency: transitive description: name: uuid url: "https://pub.dartlang.org" source: hosted - version: "0.5.3" + version: "1.0.1" + vm_service_client: + dependency: transitive + description: + name: vm_service_client + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.6" watcher: + dependency: transitive description: name: watcher url: "https://pub.dartlang.org" source: hosted - version: "0.9.7+6" + version: "0.9.7+10" web_socket_channel: + dependency: transitive description: name: web_socket_channel url: "https://pub.dartlang.org" source: hosted - version: "1.0.6" + version: "1.0.9" webdriver: + dependency: transitive description: name: webdriver url: "https://pub.dartlang.org" source: hosted version: "1.2.3" xml: + dependency: transitive description: name: xml url: "https://pub.dartlang.org" source: hosted version: "2.6.0" yaml: + dependency: "direct main" description: name: yaml url: "https://pub.dartlang.org" source: hosted - version: "2.1.13" + version: "2.1.15" sdks: - dart: ">=1.24.2 <2.0.0-dev.44" + dart: ">=2.0.0-dev.62.0 <=2.0.0-dev.69.5" diff --git a/test_fixtures/valid/tool/dev.dart b/test_fixtures/valid/tool/dev.dart index edf0784..b14e2af 100644 --- a/test_fixtures/valid/tool/dev.dart +++ b/test_fixtures/valid/tool/dev.dart @@ -12,4 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -import 'package:dart_dev/dart_dev.dart'; \ No newline at end of file +import 'package:dart_dev/dart_dev.dart'; diff --git a/tool/dev.dart b/tool/dev.dart index 1d7351e..56029bb 100644 --- a/tool/dev.dart +++ b/tool/dev.dart @@ -25,36 +25,5 @@ Future main(List args) async { config.copyLicense.directories = const ['bin/', 'lib/', 'test/', 'test_fixtures/', 'tool/']; - config.test - ..platforms = ['vm'] - ..unitTests = ['test/generated_runner.dart']; - - List ignoreDeps = [ - // executables - 'coverage', - 'dartdoc', - 'dart_style', - - // in unit tests. these happen to pass the regex and trick the executable - '_foo', 'foo', - '_bar', 'bar', - 'foo1', - 'foo_foo', - ]; - - config.taskRunner.tasksToRun = [ - 'pub run dart_dev format --check', - 'pub run dart_dev analyze', - 'pub run dependency_validator -i ${ignoreDeps.join(',')}', - 'pub run dart_dev test', - ]; - - config.genTestRunner.configs = [ - new TestRunnerConfig( - directory: 'test', - env: Environment.vm, - ), - ]; - await dev(args); } diff --git a/tool/test.sh b/tool/test.sh new file mode 100755 index 0000000..597547c --- /dev/null +++ b/tool/test.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Fast fail the script on failures. +set -e + +DART_VERSION=$(dart --version 2>&1) +DART_2_PREFIX="Dart VM version: 2" + +if [[ $DART_VERSION = $DART_2_PREFIX* ]]; then + echo -e 'pub run build_runner test' + pub run build_runner test +else + echo -e 'pub run test' + pub run test +fi From e1d67c6e46108bf698bdb611f134dfbee8e7af24 Mon Sep 17 00:00:00 2001 From: evanweible-wf Date: Tue, 31 Jul 2018 15:01:32 -0600 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index df58e5a..bc4e332 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,54 @@ +# 1.2.1 + +- Dart 2 compatible. [#35][#35] + +[#35]: https://github.com/Workiva/dependency_validator/pull/35 + +# 1.2.0 + +- **Feature:** Pinning a dependency (i.e. preventing patch or minor versions + from being consumed) now causes validator to fail. You can opt-out of this + feature with `--no-fatal-pins`. [#27][#27] + +- **Feature:** Added a `--help` flag that outputs usage information. [#28][#28] + +- **Improvement:** Package imports in `.scss` files are now detected. + [#26][#26] + +[#28]: https://github.com/Workiva/dependency_validator/pull/28 +[#27]: https://github.com/Workiva/dependency_validator/pull/27 +[#26]: https://github.com/Workiva/dependency_validator/pull/26 + +# 1.1.2 + +- Initial Dart 2/DDC compatibility changes. [#23][#23] + +[#23]: https://github.com/Workiva/dependency_validator/pull/23 + +# 1.1.1 + +- **Bug Fix:** Fix detection of packages whose names contain numbers. [#17][#17] + +[#17]: https://github.com/Workiva/dependency_validator/pull/17 + +# 1.1.0 + +- **Feature:** Added flags to control the types of validations that this tool + enforces. They all default to true, but can be opted out of like so: + + - `--no-fatal-missing` + - `--no-fatal-under-promoted` + - `--no-fatal-over-promoted` + - `--no-fatal-unused` + + [#14][#14] + +- **Feature:** Added `--exclude-dir` to allow excluding an entire directory from + the dependency validator checks. [#15][#15] + +[#15]: https://github.com/Workiva/dependency_validator/pull/15 +[#14]: https://github.com/Workiva/dependency_validator/pull/14 + # 1.0.1 - **Bug Fix:** Packages ignored via the `--ignore` option will no longer be