diff --git a/.hlint.yaml b/.hlint.yaml index 99a53206ac..0911fe5290 100644 --- a/.hlint.yaml +++ b/.hlint.yaml @@ -57,6 +57,7 @@ # the GHC2021 set. Other extensions can be added, if need be. - name: - NoImplicitPrelude + - ApplicativeDo - ConstraintKinds - DataKinds - DefaultSignatures diff --git a/src/Stack/Options/LsParser.hs b/src/Stack/Options/LsParser.hs index 2bb8cccb76..beabb006b2 100644 --- a/src/Stack/Options/LsParser.hs +++ b/src/Stack/Options/LsParser.hs @@ -1,4 +1,5 @@ {-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE ApplicativeDo #-} {-# LANGUAGE OverloadedStrings #-} -- | Function to parse command line arguments for Stack's @ls@ command. @@ -19,7 +20,7 @@ import Stack.Ls , LsView (..), SnapshotOpts (..), ListGlobalsOpts ) import Stack.Options.DotParser ( dotOptsParser ) -import Stack.Prelude +import Stack.Prelude hiding ( sep ) -- | Parse command line arguments for Stack's @ls@ command. lsOptsParser :: OA.Parser LsCmdOpts @@ -48,9 +49,9 @@ lsDepsCmd :: OA.Mod OA.CommandFields LsCmds lsDepsCmd = OA.command "dependencies" $ OA.info lsDepOptsParser $ OA.progDesc - "View the packages and versions used for a project. Use a command if \ - \the first target specified has the name of a command. Targets other \ - \than project packages are ignored." + "View the packages versions used for a project. Use a command if the \ + \first target specified has the name of a command. Targets other than \ + \project packages are ignored." <> OA.footer globalFooter lsStylesCmd :: OA.Mod OA.CommandFields LsCmds @@ -193,9 +194,13 @@ listDepsJsonParser :: OA.Parser ListDepsFormat listDepsJsonParser = pure ListDepsJSON listDepsFormatOptsParser :: OA.Parser ListDepsFormatOpts -listDepsFormatOptsParser = ListDepsFormatOpts - <$> separatorParser - <*> licenseParser +listDepsFormatOptsParser = do + license <- licenseParser + sep <- separatorParser + pure ListDepsFormatOpts + { sep + , license + } separatorParser :: OA.Parser Text separatorParser = fmap @@ -203,7 +208,7 @@ separatorParser = fmap ( textOption ( OA.long "separator" <> OA.metavar "SEP" - <> OA.help "Separator between package name and package version." + <> OA.help "Separator between package name and what follows." <> OA.value " " <> OA.showDefault )