| Index: lib/src/validator/dependency.dart
|
| diff --git a/lib/src/validator/dependency.dart b/lib/src/validator/dependency.dart
|
| index e00879ca9ebbc3fccc5008a1ab88a3f6bd234d02..9d14476f9239dca9ca45bc47a7adff8a679a88d5 100644
|
| --- a/lib/src/validator/dependency.dart
|
| +++ b/lib/src/validator/dependency.dart
|
| @@ -9,6 +9,8 @@ import 'package:pub_semver/pub_semver.dart';
|
| import '../entrypoint.dart';
|
| import '../log.dart' as log;
|
| import '../package.dart';
|
| +import '../source/hosted.dart';
|
| +import '../source/path.dart';
|
| import '../validator.dart';
|
|
|
| /// The range of all pub versions that don't support `^` version constraints.
|
| @@ -37,7 +39,7 @@ class DependencyValidator extends Validator {
|
| var caretDeps = [];
|
|
|
| for (var dependency in entrypoint.root.pubspec.dependencies) {
|
| - if (dependency.source != "hosted") {
|
| + if (dependency.source is! HostedSource) {
|
| await _warnAboutSource(dependency);
|
| } else if (dependency.constraint.isAny) {
|
| _warnAboutNoConstraint(dependency);
|
| @@ -84,10 +86,7 @@ class DependencyValidator extends Validator {
|
| }
|
|
|
| // Path sources are errors. Other sources are just warnings.
|
| - var messages = warnings;
|
| - if (dep.source == "path") {
|
| - messages = errors;
|
| - }
|
| + var messages = dep.source is PathSource ? errors : warnings;
|
|
|
| messages.add('Don\'t depend on "${dep.name}" from the ${dep.source} '
|
| 'source. Use the hosted source instead. For example:\n'
|
|
|