[commit: packages/Cabal] ghc-head: Whitespace, 80-col violations. (a952fa7)

git at git.haskell.org git at git.haskell.org
Mon Aug 26 23:30:41 CEST 2013


Repository : ssh://git@git.haskell.org/Cabal

On branch  : ghc-head
Link       : http://git.haskell.org/?p=packages/Cabal.git;a=commit;h=a952fa7fa64135041e08ea547f2331a803ed1e5c

>---------------------------------------------------------------

commit a952fa7fa64135041e08ea547f2331a803ed1e5c
Author: Mikhail Glushenkov <mikhail.glushenkov at gmail.com>
Date:   Fri Aug 23 09:43:23 2013 +0200

    Whitespace, 80-col violations.


>---------------------------------------------------------------

a952fa7fa64135041e08ea547f2331a803ed1e5c
 Cabal/Distribution/Simple/BuildTarget.hs |   46 +++++++++++++++++++-----------
 1 file changed, 30 insertions(+), 16 deletions(-)

diff --git a/Cabal/Distribution/Simple/BuildTarget.hs b/Cabal/Distribution/Simple/BuildTarget.hs
index 68f5a77..f2ef908 100644
--- a/Cabal/Distribution/Simple/BuildTarget.hs
+++ b/Cabal/Distribution/Simple/BuildTarget.hs
@@ -213,7 +213,8 @@ reportUserBuildTargetProblems problems = do
                 [ "Unrecognised build target '" ++ name ++ "'."
                 | name <- target ]
            ++ "Examples:\n"
-           ++ " - build foo          -- component name (library, executable, test-suite or benchmark)\n"
+           ++ " - build foo          -- component name "
+           ++ "(library, executable, test-suite or benchmark)\n"
            ++ " - build Data.Foo     -- module name\n"
            ++ " - build Data/Foo.hsc -- file name\n"
            ++ " - build lib:foo exe:foo   -- component qualified by kind\n"
@@ -262,7 +263,8 @@ resolveBuildTarget pkg userTarget fexists =
       Unambiguous target  -> Right target
       Ambiguous   targets -> Left (BuildTargetAmbigious userTarget targets')
                                where targets' = disambiguateBuildTargets
-                                                    (packageId pkg) userTarget targets
+                                                    (packageId pkg) userTarget
+                                                    targets
       None        errs    -> Left (classifyMatchErrors errs)
 
   where
@@ -277,13 +279,16 @@ resolveBuildTarget pkg userTarget fexists =
 
 
 data BuildTargetProblem
-   = BuildTargetExpected  UserBuildTarget [String]  String    --  [expected thing] (actually got)
-   | BuildTargetNoSuch    UserBuildTarget [(String, String)]  --  [(no such thing,  actually got)]
+   = BuildTargetExpected  UserBuildTarget [String]  String
+     -- ^  [expected thing] (actually got)
+   | BuildTargetNoSuch    UserBuildTarget [(String, String)]
+     -- ^ [(no such thing,  actually got)]
    | BuildTargetAmbigious UserBuildTarget [(UserBuildTarget, BuildTarget)]
   deriving Show
 
 
-disambiguateBuildTargets :: PackageId -> UserBuildTarget -> [BuildTarget] -> [(UserBuildTarget, BuildTarget)]
+disambiguateBuildTargets :: PackageId -> UserBuildTarget -> [BuildTarget]
+                         -> [(UserBuildTarget, BuildTarget)]
 disambiguateBuildTargets pkgid original =
     disambiguate (userTargetQualLevel original)
   where
@@ -400,14 +405,16 @@ matchBuildTarget1 cinfo str1 fexists =
    `matchPlusShadowing` matchFile1      cinfo str1 fexists
 
 
-matchBuildTarget2 :: [ComponentInfo] -> String -> String -> Bool -> Match BuildTarget
+matchBuildTarget2 :: [ComponentInfo] -> String -> String -> Bool
+                  -> Match BuildTarget
 matchBuildTarget2 cinfo str1 str2 fexists =
                         matchComponent2 cinfo str1 str2
    `matchPlusShadowing` matchModule2    cinfo str1 str2
    `matchPlusShadowing` matchFile2      cinfo str1 str2 fexists
 
 
-matchBuildTarget3 :: [ComponentInfo] -> String -> String -> String -> Bool -> Match BuildTarget
+matchBuildTarget3 :: [ComponentInfo] -> String -> String -> String -> Bool
+                  -> Match BuildTarget
 matchBuildTarget3 cinfo str1 str2 str3 fexists =
                         matchModule3    cinfo str1 str2 str3
    `matchPlusShadowing` matchFile3      cinfo str1 str2 str3 fexists
@@ -493,9 +500,12 @@ matchComponentKind :: String -> Match ComponentKind
 matchComponentKind s
   | s `elem` ["lib", "library"]            = increaseConfidence >> return LibKind
   | s `elem` ["exe", "executable"]         = increaseConfidence >> return ExeKind
-  | s `elem` ["tst", "test", "test-suite"] = increaseConfidence >> return TestKind
-  | s `elem` ["bench", "benchmark"]        = increaseConfidence >> return BenchKind
-  | otherwise                              = matchErrorExpected "component kind" s
+  | s `elem` ["tst", "test", "test-suite"] = increaseConfidence
+                                             >> return TestKind
+  | s `elem` ["bench", "benchmark"]        = increaseConfidence
+                                             >> return BenchKind
+  | otherwise                              = matchErrorExpected
+                                             "component kind" s
 
 showComponentKind :: ComponentKind -> String
 showComponentKind LibKind   = "library"
@@ -545,7 +555,8 @@ matchComponentName cs str =
       [ (cinfoStrName c, c) | c <- cs ]
       str
 
-matchComponentKindAndName :: [ComponentInfo] -> ComponentKind -> String -> Match ComponentInfo
+matchComponentKindAndName :: [ComponentInfo] -> ComponentKind -> String
+                          -> Match ComponentInfo
 matchComponentKindAndName cs ckind str =
     orNoSuchThing (showComponentKind ckind ++ " component") str
   $ increaseConfidenceFor
@@ -576,7 +587,8 @@ matchModule2 cs = \str1 str2 -> do
     m <- matchModuleName ms str2
     return (BuildTargetModule (cinfoName c) m)
 
-matchModule3 :: [ComponentInfo] -> String -> String -> String -> Match BuildTarget
+matchModule3 :: [ComponentInfo] -> String -> String -> String
+             -> Match BuildTarget
 matchModule3 cs str1 str2 str3 = do
     ckind <- matchComponentKind str1
     guardComponentName str2
@@ -626,7 +638,8 @@ matchFile2 cs str1 str2 exists = do
     return (BuildTargetFile (cinfoName c) filepath)
 
 
-matchFile3 :: [ComponentInfo] -> String -> String -> String -> Bool -> Match BuildTarget
+matchFile3 :: [ComponentInfo] -> String -> String -> String -> Bool
+           -> Match BuildTarget
 matchFile3 cs str1 str2 str3 exists = do
     ckind <- matchComponentKind str1
     guardComponentName str2
@@ -744,11 +757,13 @@ matchZero = NoMatch 0 []
 -- ambigious matches.
 --
 matchPlus :: Match a -> Match a -> Match a
-matchPlus   (ExactMatch   d1 xs)   (ExactMatch   d2 xs') = ExactMatch (max d1 d2) (xs ++ xs')
+matchPlus   (ExactMatch   d1 xs)   (ExactMatch   d2 xs') =
+  ExactMatch (max d1 d2) (xs ++ xs')
 matchPlus a@(ExactMatch   _  _ )   (InexactMatch _  _  ) = a
 matchPlus a@(ExactMatch   _  _ )   (NoMatch      _  _  ) = a
 matchPlus   (InexactMatch _  _ ) b@(ExactMatch   _  _  ) = b
-matchPlus   (InexactMatch d1 xs)   (InexactMatch d2 xs') = InexactMatch (max d1 d2) (xs ++ xs')
+matchPlus   (InexactMatch d1 xs)   (InexactMatch d2 xs') =
+  InexactMatch (max d1 d2) (xs ++ xs')
 matchPlus a@(InexactMatch _  _ )   (NoMatch      _  _  ) = a
 matchPlus   (NoMatch      _  _ ) b@(ExactMatch   _  _  ) = b
 matchPlus   (NoMatch      _  _ ) b@(InexactMatch _  _  ) = b
@@ -910,4 +925,3 @@ matchInexactly cannonicalise xs =
 
 caseFold :: String -> String
 caseFold = lowercase
-





More information about the ghc-commits mailing list