Skip to content

Commit

Permalink
Merge pull request #35 from Workiva/dart2
Browse files Browse the repository at this point in the history
AF-1879 Dart 2 compatibility
  • Loading branch information
rmconsole7-wk authored Jul 31, 2018
2 parents 7817284 + e1d67c6 commit 3733edb
Show file tree
Hide file tree
Showing 19 changed files with 450 additions and 256 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
51 changes: 51 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/src/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ Iterable<File> listScssFilesIn(String dirPath, List<String> excludedDirs) =>
Iterable<File> listFilesWithExtensionIn(String dirPath, List<String> excludedDirs, String extension) {
if (!FileSystemEntity.isDirectorySync(dirPath)) return const [];

return new Directory(dirPath).listSync(recursive: true).where((entity) {
return new List<File>.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
Expand Down
11 changes: 6 additions & 5 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ authors:
- Evan Weible <[email protected]>

environment:
sdk: ">=1.24.2 <2.0.0"
sdk: '>=1.24.2 <3.0.0'

dependencies:
args: '>=0.13.7 <2.0.0'
Expand All @@ -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:
File renamed without changes.
13 changes: 0 additions & 13 deletions test/generated_runner.dart

This file was deleted.

File renamed without changes.
91 changes: 52 additions & 39 deletions test_fixtures/analyzer/pubspec.lock
Original file line number Diff line number Diff line change
@@ -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"
Loading

0 comments on commit 3733edb

Please sign in to comment.