Skip to content

Commit f2f2287

Browse files
committed
Refine stated/actuals diffs on package dep/constraint mismatches
1 parent b0a036e commit f2f2287

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

builder/src/Elm/Details.hs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,18 @@ verifyApp env time outline@(Outline.AppOutline elmVersion srcDirs direct _ _ _)
253253
if Map.size stated == Map.size actual
254254
then verifyDependencies env time (ValidApp srcDirs) actual direct
255255
else Task.throw $ Exit.DetailsHandEditedDependencies
256-
$ "The stated and actual dependencies do not match.\n\n"
257-
++ "Stated: " ++ show stated ++ "\n\nActual: " ++ show actual
256+
$ let
257+
stateds = stated & fmap (\k _ -> k)
258+
actuals = actual & fmap (\k _ -> k)
259+
260+
-- first, everything in stated that's not in actual
261+
missing = Map.difference stateds actuals & Map.toList & fmap fst & show
262+
-- then, everything in actual that's not in stated
263+
extra = Map.difference actuals stateds & Map.toList & fmap fst & show
264+
in
265+
"The stated and actual dependencies do not match.\n\n"
266+
++ "Stated missing in actual: " ++ show missing
267+
++ "\n\nActual missing in stated: " ++ show extra
258268
else
259269
Task.throw $ Exit.DetailsBadElmInAppOutline elmVersion
260270

0 commit comments

Comments
 (0)