File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ packageConfigToJSON =
8484 TL. toStrict
8585 . TB. toLazyText
8686 . encodePrettyToTextBuilder' config
87+ . sortDependencies
8788 where
8889 config = defConfig
8990 { confCompare =
@@ -95,18 +96,23 @@ packageConfigToJSON =
9596 , confIndent = Spaces 2
9697 , confTrailingNewline = True
9798 }
99+ sortDependencies conf = conf { depends = List. sort (depends conf) }
98100
99101packageSetToJSON :: PackageSet -> Text
100102packageSetToJSON =
101103 TL. toStrict
102104 . TB. toLazyText
103105 . encodePrettyToTextBuilder' config
106+ . sortDependencies
104107 where
105108 config = defConfig
106109 { confCompare = compare
107110 , confIndent = Spaces 2
108111 , confTrailingNewline = True
109112 }
113+ sortDependencies set = updateDependencies <$> set
114+ updateDependencies pkg =
115+ pkg { dependencies = List. sort (dependencies pkg) }
110116
111117writePackageFile :: PackageConfig -> IO ()
112118writePackageFile =
You can’t perform that action at this time.
0 commit comments