LGTM, thanks

On Tue, May 20, 2014 at 3:56 PM, 'Klaus Aehlig' via ganeti-devel <
[email protected]> wrote:

> ...by fixing lint warnings found by HLint v1.8.57. In particular,
> make sure 'make hlint' passes for this version of hlint.
>
> Signed-off-by: Klaus Aehlig <[email protected]>
> ---
>  src/Ganeti/HTools/Program/Hspace.hs    | 2 +-
>  src/Ganeti/JQueue.hs                   | 3 ++-
>  src/Ganeti/Monitoring/Server.hs        | 4 ++--
>  test/hs/Test/Ganeti/HTools/Instance.hs | 3 ++-
>  4 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/src/Ganeti/HTools/Program/Hspace.hs
> b/src/Ganeti/HTools/Program/Hspace.hs
> index 9f0561e..be90482 100644
> --- a/src/Ganeti/HTools/Program/Hspace.hs
> +++ b/src/Ganeti/HTools/Program/Hspace.hs
> @@ -385,7 +385,7 @@ failureReason = show . fst . head
>
>  -- | Sorts the failure reasons.
>  sortReasons :: [(FailMode, Int)] -> [(FailMode, Int)]
> -sortReasons = reverse . sortBy (comparing snd)
> +sortReasons = sortBy (flip $ comparing snd)
>
>  -- | Runs an allocation algorithm and saves cluster state.
>  runAllocation :: ClusterData                -- ^ Cluster data
> diff --git a/src/Ganeti/JQueue.hs b/src/Ganeti/JQueue.hs
> index 828e662..8e01d88 100644
> --- a/src/Ganeti/JQueue.hs
> +++ b/src/Ganeti/JQueue.hs
> @@ -45,6 +45,7 @@ module Ganeti.JQueue
>      , noSuchJob
>      ) where
>
> +import Control.Applicative((<$>))
>  import Control.Exception
>  import Control.Monad
>  import Data.List
> @@ -235,7 +236,7 @@ determineJobDirectories rootdir archived = do
>  -- FIXME: delete this and just use \'sequence\' instead when Lucid
> compatibility
>  -- will not be required anymore.
>  sequencer :: [Either IOError [JobId]] -> Either IOError [[JobId]]
> -sequencer l = fmap reverse $ foldl seqFolder (Right []) l
> +sequencer l = reverse <$> foldl seqFolder (Right []) l
>
>  -- | Folding function for joining multiple [JobIds] into one list.
>  seqFolder :: Either IOError [[JobId]]
> diff --git a/src/Ganeti/Monitoring/Server.hs
> b/src/Ganeti/Monitoring/Server.hs
> index dc010b4..1959f3d 100644
> --- a/src/Ganeti/Monitoring/Server.hs
> +++ b/src/Ganeti/Monitoring/Server.hs
> @@ -176,8 +176,8 @@ error404 = do
>  -- | Return the report of one collector
>  oneReport :: Snap ()
>  oneReport = do
> -  categoryName <- fmap (maybe mzero unpack) $ getParam "category"
> -  collectorName <- fmap (maybe mzero unpack) $ getParam "collector"
> +  categoryName <- maybe mzero unpack <$> getParam "category"
> +  collectorName <- maybe mzero unpack <$> getParam "collector"
>    category <-
>      case catFromName categoryName of
>        BT.Ok cat -> return cat
> diff --git a/test/hs/Test/Ganeti/HTools/Instance.hs
> b/test/hs/Test/Ganeti/HTools/Instance.hs
> index 9c09103..60c6ba1 100644
> --- a/test/hs/Test/Ganeti/HTools/Instance.hs
> +++ b/test/hs/Test/Ganeti/HTools/Instance.hs
> @@ -35,6 +35,7 @@ module Test.Ganeti.HTools.Instance
>    , Instance.Instance(..)
>    ) where
>
> +import Control.Applicative ((<$>))
>  import Control.Monad (liftM)
>  import Test.QuickCheck hiding (Result)
>
> @@ -112,7 +113,7 @@ genInstanceOnNodeList nl = do
>  genInstanceList :: Gen Instance.Instance -> Gen Instance.List
>  genInstanceList igen = fmap (snd . Loader.assignIndices) names_instances
>      where names_instances =
> -            (fmap . map) (\n -> (Instance.name n, n)) $ listOf igen
> +            map (\n -> (Instance.name n, n)) <$> listOf igen
>
>  -- let's generate a random instance
>  instance Arbitrary Instance.Instance where
> --
> 1.9.1.423.g4596e3a
>
>


-- 
-- 
Helga Velroyen | Software Engineer | [email protected] |

Google Germany GmbH
Dienerstr. 12
80331 München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Graham Law, Christine Elizabeth Flores

Reply via email to