summaryrefslogtreecommitdiff
path: root/cli/tools/registry/diagnostics.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tools/registry/diagnostics.rs')
-rw-r--r--cli/tools/registry/diagnostics.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/cli/tools/registry/diagnostics.rs b/cli/tools/registry/diagnostics.rs
index e1c6e4e65..69434f1ea 100644
--- a/cli/tools/registry/diagnostics.rs
+++ b/cli/tools/registry/diagnostics.rs
@@ -120,8 +120,7 @@ pub enum PublishDiagnostic {
},
SyntaxError(ParseDiagnostic),
MissingLicense {
- /// This only exists because diagnostics require a location.
- expected_path: PathBuf,
+ config_specifier: Url,
},
}
@@ -214,7 +213,7 @@ impl Diagnostic for PublishDiagnostic {
MissingConstraint { specifier, .. } => Cow::Owned(format!("specifier '{}' is missing a version constraint", specifier)),
BannedTripleSlashDirectives { .. } => Cow::Borrowed("triple slash directives that modify globals are not allowed"),
SyntaxError(diagnostic) => diagnostic.message(),
- MissingLicense { .. } => Cow::Borrowed("missing license file"),
+ MissingLicense { .. } => Cow::Borrowed("missing license field or file"),
}
}
@@ -282,8 +281,8 @@ impl Diagnostic for PublishDiagnostic {
text_info: Cow::Borrowed(text_info),
},
SyntaxError(diagnostic) => diagnostic.location(),
- MissingLicense { expected_path } => DiagnosticLocation::Path {
- path: expected_path.clone(),
+ MissingLicense { config_specifier } => DiagnosticLocation::Module {
+ specifier: Cow::Borrowed(config_specifier),
},
}
}
@@ -400,7 +399,7 @@ impl Diagnostic for PublishDiagnostic {
),
SyntaxError(diagnostic) => diagnostic.hint(),
MissingLicense { .. } => Some(
- Cow::Borrowed("add a LICENSE file to the package and ensure it is not ignored from being published"),
+ Cow::Borrowed("add a \"license\" field. Alternatively, add a LICENSE file to the package and ensure it is not ignored from being published"),
),
}
}