Unverified Commit a4bc470f authored by Phil Quitslund's avatar Phil Quitslund Committed by GitHub

Tweak access to linter internals in package validation. (#13297)

A more future-proof approach to accessing internal package name lint rule description details.

See: https://github.com/dart-lang/linter/issues/654
parent 1d6bb3cc
......@@ -367,9 +367,10 @@ final Set<String> _packageDependencies = new Set<String>.from(<String>[
/// Return null if the project name is legal. Return a validation message if
/// we should disallow the project name.
String _validateProjectName(String projectName) {
if (!linter_utils.isValidPackageName(projectName))
return '"$projectName" is not a valid Dart package name.\n\n${package_names.details}';
if (!linter_utils.isValidPackageName(projectName)) {
final String packageNameDetails = new package_names.PubPackageNames().details;
return '"$projectName" is not a valid Dart package name.\n\n$packageNameDetails';
}
if (_packageDependencies.contains(projectName)) {
return "Invalid project name: '$projectName' - this will conflict with Flutter "
'package dependencies.';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment