Skip to content

Commit

Permalink
style: improve spdx license error (#750)
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun authored Apr 2, 2024
1 parent 5dda526 commit 31f3a8d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/recipe/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,15 @@ impl fmt::Display for ErrorKind {
ErrorKind::UrlParsing(err) => write!(f, "failed to parse URL: {}", err),
ErrorKind::IntegerParsing(err) => write!(f, "failed to parse integer: {}", err),
ErrorKind::SpdxParsing(err) => {
write!(f, "failed to parse SPDX license: {}", err.reason)
writeln!(f, "failed to parse SPDX license: {}", err.reason)?;
writeln!(
f,
"See <https://spdx.org/licenses> for the list of valid licenses."
)?;
write!(
f,
"Use 'LicenseRef-<MyLicense>' if you are using a custom license."
)
}
ErrorKind::MatchSpecParsing(err) => {
write!(f, "failed to parse match spec: {}", err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ expression: err
× Failed to parse recipe

Error: × Parsing: failed to parse SPDX license: invalid character(s)
See <https://spdx.org/licenses> for the list of valid licenses.
Use 'LicenseRef-<MyLicense>' if you are using a custom license.
╭─[7:22]
6about:
7license: MIT/X derivate
· ───────┬──────
· ╰── here
8
╰────

0 comments on commit 31f3a8d

Please sign in to comment.