Skip to content

Commit

Permalink
Add support for ReorderModule settings and add some
Browse files Browse the repository at this point in the history
  • Loading branch information
ndmitchell committed Jun 1, 2016
1 parent d57573b commit 72746c9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
16 changes: 11 additions & 5 deletions misc/settings.txt
@@ -1,9 +1,7 @@
-- A list of tag renamings, installed as a data file on the users machine.
-- Used to when the same semantic value is used multiple times with
-- typos/names/capitalisation.
--
-- This file is global and applies to all Cabal files.
-- A list of settings, installed as a data file on the users machine.

-- Applied to cabal fields when the same semantic value is used multiple times with
-- typos/names/capitalisation.
RenameTag "Silk-B.V." "Silk"
RenameTag "Silk.-B.V." "Silk"
RenameTag "Michael-snoyman" "Michael-Snoyman"
Expand All @@ -26,3 +24,11 @@ RenameTag "Error-handling" "Error-Handling"
RenameTag "Daniel-Schüssler" "Daniel Schüssler"
RenameTag "Various" ""
RenameTag "Various;-see-individual-modules" ""

-- Reorder modules so the common things come first
ReorderModule "base" "Prelude" 1009
ReorderModule "base" "Data.List" 1008
ReorderModule "base" "Data.Maybe" 1007
ReorderModule "base" "Data.Function" 1006
ReorderModule "base" "Control.Monad" 1005
ReorderModule "base" "GHC.*" (-1000)
3 changes: 3 additions & 0 deletions src/Input/Settings.hs
Expand Up @@ -16,6 +16,9 @@ data Setting
= -- | Given a Cabal tag/author rename it from the LHS to the RHS.
-- If the RHS is blank, delete the tag.
RenameTag String String
| -- | Change the priority of a module. Given package name, module name, new priority.
-- Use * for wildcard matches. All un-reordered modules are 0
ReorderModule String String Int
deriving Read


Expand Down

0 comments on commit 72746c9

Please sign in to comment.