Skip to content

Commit 48d01f8

Browse files
authored
Merge pull request #11659 from cabalism/hlint/move-guards-fwd
Follow hlint suggestion: move guards forward
2 parents 96a1e8f + caf0a92 commit 48d01f8

5 files changed

Lines changed: 7 additions & 10 deletions

File tree

.hlint.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
- ignore: {name: "Eta reduce"} # 138 hints
66
- ignore: {name: "Hoist not"} # 16 hints
77
- ignore: {name: "Move filter"} # 4 hints
8-
- ignore: {name: "Move guards forward"} # 5 hints
98
- ignore: {name: "Redundant $!"} # 1 hint
109
- ignore: {name: "Redundant <$>"} # 17 hints
1110
- ignore: {name: "Redundant bracket"} # 257 hints

Cabal/src/Distribution/Simple/Haddock.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,8 +1277,8 @@ renderPureArgs version comp platform args =
12771277
flagToMaybe (argGhcLibDir args) -- error if Nothing?
12781278
, -- https://github.com/haskell/haddock/pull/547
12791279
[ "--reexport=" ++ prettyShow r
1280-
| r <- argReexports args
1281-
, isVersion 2 19
1280+
| isVersion 2 19
1281+
, r <- argReexports args
12821282
]
12831283
, argTargets args
12841284
, maybe [] ((: []) . (resourcesDirFlag ++)) . flagToMaybe . argResourcesDir $ args

Cabal/src/Distribution/Simple/Program/GHC.hs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,7 @@ renderGhcOptions comp _platform@(Platform _arch os) opts
852852
, concat [["-odir", u dir] | dir <- flag ghcOptObjDir]
853853
, concat [["-hidir", u dir] | dir <- flag ghcOptHiDir]
854854
, concat [["-hiedir", u dir] | dir <- flag ghcOptHieDir]
855-
, concat [["-gbcdir", u dir] | dir <- flag ghcOptBytecodeDir, bytecodeArtifactsSupported comp]
855+
, concat [["-gbcdir", u dir] | bytecodeArtifactsSupported comp, dir <- flag ghcOptBytecodeDir]
856856
, concat [["-stubdir", u dir] | dir <- flag ghcOptStubDir]
857857
, -----------------------
858858
-- Source search path
@@ -965,9 +965,7 @@ renderGhcOptions comp _platform@(Platform _arch os) opts
965965
, ----------------
966966
-- GHCi
967967

968-
concat
969-
[ ["-ghci-script", script] | script <- ghcOptGHCiScripts opts, flagGhciScript implInfo
970-
]
968+
concat [["-ghci-script", script] | flagGhciScript implInfo, script <- ghcOptGHCiScripts opts]
971969
, ---------------
972970
-- Inputs
973971

cabal-install/src/Distribution/Client/Errors.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,8 +712,7 @@ exceptionMessageCabalInstall e = case e of
712712
| (thing, _got, alts@(_ : _)) <- nosuch'
713713
]
714714
]
715-
| (target, nosuch) <- targets
716-
, let groupByContainer =
715+
| let groupByContainer =
717716
map
718717
( \g@((inside, _, _, _) : _) ->
719718
( inside
@@ -724,6 +723,7 @@ exceptionMessageCabalInstall e = case e of
724723
)
725724
. groupBy ((==) `on` (\(x, _, _, _) -> x))
726725
. sortBy (compare `on` (\(x, _, _, _) -> x))
726+
, (target, nosuch) <- targets
727727
]
728728
where
729729
mungeThing "file" = "file target"

cabal-install/src/Distribution/Client/Install.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1198,8 +1198,8 @@ storeDetailedBuildReports verbosity logsDir reports =
11981198
createDirectoryIfMissing True reportsDir -- FIXME
11991199
writeFile reportFile (show (showBuildReport report, buildLog))
12001200
| (report, Just repo) <- reports
1201-
, Just remoteRepo <- [maybeRepoRemote repo]
12021201
, isLikelyToHaveLogFile (BuildReports.installOutcome report)
1202+
, Just remoteRepo <- [maybeRepoRemote repo]
12031203
]
12041204
where
12051205
isLikelyToHaveLogFile BuildReports.ConfigureFailed{} = True

0 commit comments

Comments
 (0)