From 417ab39ca4005f441ad030a3b7f3d0ab5133e2b1 Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Wed, 21 Nov 2012 13:14:05 +0100 Subject: [PATCH] A few more hlint fixes I'm ignoring the use of Control.Arrow.*** since it's a non-obvious function, and we're not widely using Arrows in the code base, so I think switching to it would make the code less readable to most people. Signed-off-by: Iustin Pop <iustin@google.com> Reviewed-by: Helga Velroyen <helgav@google.com> --- htest/Test/Ganeti/OpCodes.hs | 2 +- htools/Ganeti/JSON.hs | 1 + htools/Ganeti/OpParams.hs | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htest/Test/Ganeti/OpCodes.hs b/htest/Test/Ganeti/OpCodes.hs index cf17dd91c..51dd653ec 100644 --- a/htest/Test/Ganeti/OpCodes.hs +++ b/htest/Test/Ganeti/OpCodes.hs @@ -197,7 +197,7 @@ genNodeNames = resize maxNodes (listOf getFQDN) -- | Generates a list of node names in non-empty string type. genNodeNamesNE :: Gen [NonEmptyString] -genNodeNamesNE = genNodeNames >>= mapM (mkNonEmpty) +genNodeNamesNE = genNodeNames >>= mapM mkNonEmpty -- | Gets a node name in non-empty type. genNodeNameNE :: Gen NonEmptyString diff --git a/htools/Ganeti/JSON.hs b/htools/Ganeti/JSON.hs index 113889834..cc666128a 100644 --- a/htools/Ganeti/JSON.hs +++ b/htools/Ganeti/JSON.hs @@ -202,6 +202,7 @@ readContainer obj = do return (k', v')) kjvlist return $ GenericContainer (Map.fromList kalist) +{-# ANN showContainer "HLint: ignore Use ***" #-} -- | Container dumper. showContainer :: (HasStringRepr a, J.JSON b) => GenericContainer a b -> J.JSValue diff --git a/htools/Ganeti/OpParams.hs b/htools/Ganeti/OpParams.hs index bd7246cd2..40a7b834d 100644 --- a/htools/Ganeti/OpParams.hs +++ b/htools/Ganeti/OpParams.hs @@ -345,14 +345,14 @@ pGroupName = simpleField "group_name" [t| NonEmptyString |] -- | Migration type (live\/non-live). pMigrationMode :: Field pMigrationMode = - renameField "MigrationMode" $ + renameField "MigrationMode" . optionalField $ simpleField "mode" [t| MigrationMode |] -- | Obsolete \'live\' migration mode (boolean). pMigrationLive :: Field pMigrationLive = - renameField "OldLiveMode" $ optionalField $ booleanField "live" + renameField "OldLiveMode" . optionalField $ booleanField "live" -- | Whether to force an unknown OS variant. pForceVariant :: Field @@ -440,7 +440,7 @@ pIgnoreErrors = defaultField [| Set.empty |] $ -- | Optional group name. pOptGroupName :: Field -pOptGroupName = renameField "OptGroupName" $ +pOptGroupName = renameField "OptGroupName" . optionalField $ simpleField "group_name" [t| NonEmptyString |] -- | Disk templates' parameter defaults. -- GitLab