@@ -55,13 +55,13 @@ data PackageWarning
55-- | An error that should be fixed by the user.
55-- | An error that should be fixed by the user.
56data UserError
56data UserError
57 = BowerJSONNotFound
57 = BowerJSONNotFound
59 | BowerExecutableNotFound [String] -- list of executable names tried
58 | BowerExecutableNotFound [String] -- list of executable names tried
60 | CouldntDecodeBowerJSON (ParseError BowerError)
59 | CouldntDecodeBowerJSON (ParseError BowerError)
61 | TagMustBeCheckedOut
60 | TagMustBeCheckedOut
62 | AmbiguousVersions [Version] -- Invariant: should contain at least two elements
61 | AmbiguousVersions [Version] -- Invariant: should contain at least two elements
63 | BadRepositoryField RepositoryFieldError
62 | BadRepositoryField RepositoryFieldError
64 | NoLicenseSpecified
63 | NoLicenseSpecified
65 | MissingDependencies (NonEmpty PackageName)
65 | MissingDependencies (NonEmpty PackageName)
66 | CompileError P.MultipleErrors
66 | CompileError P.MultipleErrors
67 | DirtyWorkingTree
67 | DirtyWorkingTree
@@ -129,12 +129,6 @@ displayUserError e = case e of
129 "The bower.json file was not found. Please create one, or run " ++
129 "The bower.json file was not found. Please create one, or run " ++
130 "`pulp init`."
130 "`pulp init`."
134− ["No LICENSE file was found. Please create one. ",
135− "Distributing code without a license means that nobody ",
136− "will be able to (legally) use it."
138 BowerExecutableNotFound names ->
132 BowerExecutableNotFound names ->
139 para (concat
133 para (concat
140 [ "The Bower executable was not found (tried: ", format names, "). Please"
134 [ "The Bower executable was not found (tried: ", format names, "). Please"
@@ -189,14 +183,7 @@ displayUserError e = case e of
189 , "following would be acceptable:"
183 , "following would be acceptable:"
192− ] ++
186+ ] ++ spdxExamples ++
193− map (indented . para)
195− , "* \"BSD-2-Clause\""
197− , "* \"(GPL-3.0 OR MIT)\""
201 , para (concat
188 , para (concat
202 [ "Note that distributing code without a license means that nobody "
189 [ "Note that distributing code without a license means that nobody "
@@ -209,6 +196,16 @@ displayUserError e = case e of
209 , "necessary."
196 , "necessary."
202+ [ "The license specified in bower.json is not a valid SPDX license "
203+ , "expression. Please use the SPDX license expression format. For "
204+ , "example, any of the following would be acceptable:"
212 MissingDependencies pkgs ->
209 MissingDependencies pkgs ->
213 let singular = NonEmpty.length pkgs == 1
210 let singular = NonEmpty.length pkgs == 1
214 pl a b = if singular then b else a
211 pl a b = if singular then b else a
@@ -239,6 +236,16 @@ displayUserError e = case e of
239 "your changes first."
236 "your changes first."
239+spdxExamples :: [Box]
241+ map (indented . para)
243+ , "* \"Apache-2.0\""
244+ , "* \"BSD-2-Clause\""
246+ , "* \"(GPL-3.0 OR MIT)\""
242displayRepositoryError :: RepositoryFieldError -> Box
249displayRepositoryError :: RepositoryFieldError -> Box
243displayRepositoryError err = case err of
250displayRepositoryError err = case err of
244 RepositoryFieldMissing ->
251 RepositoryFieldMissing ->