on master help sign in
Rename some of the diff errors / add one for missing elm.json
0b55695Evan Czaplicki
builder/src/Reporting/Exit.hs+22−10
@@ -147,22 +147,34 @@ initToReport exit =
147
147
148
148
149data Diff
149data Diff
150+ = DiffNoOutline
150− = DiffApplication
151+ | DiffApplication
151 | DiffUnpublished
152 | DiffUnpublished
152 | DiffUnknownPackage Pkg.Name [Pkg.Name]
153 | DiffUnknownPackage Pkg.Name [Pkg.Name]
153 | DiffUnknownVersion Pkg.Name V.Version [V.Version]
154 | DiffUnknownVersion Pkg.Name V.Version [V.Version]
154− | DiffCannotFindDocs DocsProblem
155+ | DiffDocsProblem DocsProblem
155− | DiffMustHaveLatestRegistry RegistryProblem
156+ | DiffBadRegistry RegistryProblem
157+ | DiffBadDetails Details
156
158
157
159
158diffToReport :: Diff -> Help.Report
160diffToReport :: Diff -> Help.Report
159diffToReport diff =
161diffToReport diff =
160 case diff of
162 case diff of
163+ DiffNoOutline ->
164+ Help.report "DIFF WHAT?" Nothing
165+ "I cannot find an elm.json so I am not sure what you want me to diff.\
166+ \ Normally you run `elm diff` from within a project!"
167+ [ D.reflow $ "If you are just curious to see a diff, try running this command:"
168+ , D.indent 4 $ D.green $ "elm diff elm/html 5.1.1 6.0.0"
169+ ]
170+
161 DiffApplication ->
171 DiffApplication ->
162 Help.report "CANNOT DIFF APPLICATIONS" Nothing
172 Help.report "CANNOT DIFF APPLICATIONS" Nothing
163− "I cannot perform diffs on applications, only packages! If you are\
173+ "It looks like you are running `elm diff` on an application, but it\
174+ \ only makes sense for packages that have been published. That way\
175+ \ there is a fixed API to diff against."
164− \ just curious to see a diff, try running this command:"
176+ [ D.reflow $ "If you are just curious to see a diff, try running this command:"
165− [ D.indent 4 $ D.green $ "elm diff elm/html 5.1.1 6.0.0"
177+ , D.indent 4 $ D.green $ "elm diff elm/html 5.1.1 6.0.0"
166 ]
178 ]
167
179
168 DiffUnpublished ->
180 DiffUnpublished ->
@@ -198,11 +210,11 @@ diffToReport diff =
198 , "Want one of those instead?"
210 , "Want one of those instead?"
199 ]
211 ]
200
212
201− DiffCannotFindDocs problem ->
213+ DiffDocsProblem problem ->
202− error "TODO DiffCannotFindDocs" problem
214+ error "TODO DiffDocsProblem" problem
203
215
204− DiffMustHaveLatestRegistry problem ->
216+ DiffBadRegistry problem ->
205− error "TODO DiffMustHaveLatestRegistry" problem
217+ error "TODO DiffBadRegistry" problem
206
218
207
219
208
220