diff --git a/.hlint.yaml b/.hlint.yaml index a4291666ca0..43ea3f9a5c3 100644 --- a/.hlint.yaml +++ b/.hlint.yaml @@ -2,7 +2,7 @@ - ignore: {name: "Avoid NonEmpty.unzip"} # 1 hint - ignore: {name: "Avoid lambda"} # 50 hints - ignore: {name: "Avoid lambda using `infix`"} # 23 hints -- ignore: {name: "Eta reduce"} # 136 hints +- ignore: {name: "Eta reduce"} # 137 hints - ignore: {name: "Evaluate"} # 10 hints - ignore: {name: "Functor law"} # 10 hints - ignore: {name: "Fuse concatMap/map"} # 3 hints @@ -19,27 +19,25 @@ - ignore: {name: "Redundant guard"} # 2 hints - ignore: {name: "Redundant if"} # 6 hints - ignore: {name: "Redundant lambda"} # 19 hints -- ignore: {name: "Redundant maybe"} # 2 hints - ignore: {name: "Redundant multi-way if"} # 1 hint -- ignore: {name: "Redundant return"} # 10 hints +- ignore: {name: "Redundant return"} # 9 hints - ignore: {name: "Replace case with fromMaybe"} # 4 hints - ignore: {name: "Replace case with maybe"} # 10 hints - ignore: {name: "Use $>"} # 5 hints - ignore: {name: "Use ++"} # 4 hints -- ignore: {name: "Use :"} # 28 hints +- ignore: {name: "Use :"} # 29 hints - ignore: {name: "Use <$"} # 2 hints -- ignore: {name: "Use <$>"} # 87 hints +- ignore: {name: "Use <$>"} # 86 hints - ignore: {name: "Use <&>"} # 16 hints - ignore: {name: "Use <=<"} # 4 hints - ignore: {name: "Use =<<"} # 7 hints -- ignore: {name: "Use =="} # 2 hints - ignore: {name: "Use >=>"} # 3 hints - ignore: {name: "Use Down"} # 3 hints - ignore: {name: "Use bimap"} # 7 hints - ignore: {name: "Use camelCase"} # 96 hints - ignore: {name: "Use catMaybes"} # 4 hints - ignore: {name: "Use concatMap"} # 2 hints -- ignore: {name: "Use const"} # 37 hints +- ignore: {name: "Use const"} # 36 hints - ignore: {name: "Use fmap"} # 23 hints - ignore: {name: "Use fold"} # 1 hint - ignore: {name: "Use fromMaybe"} # 5 hints diff --git a/Cabal/src/Distribution/Simple/Configure.hs b/Cabal/src/Distribution/Simple/Configure.hs index 73c1df20247..baf18d21120 100644 --- a/Cabal/src/Distribution/Simple/Configure.hs +++ b/Cabal/src/Distribution/Simple/Configure.hs @@ -2816,7 +2816,7 @@ checkRelocatable verbosity pkg lbi = -- Check if the Compiler support relocatable builds checkCompiler = - unless (compilerFlavor comp `elem` [GHC]) $ + unless (compilerFlavor comp == GHC) $ dieWithException verbosity $ NoCompilerSupport (show comp) where @@ -2857,7 +2857,7 @@ checkRelocatable verbosity pkg lbi = traverse_ (doCheck $ getSymbolicPath pkgr) ipkgs where doCheck pkgr ipkg - | maybe False (== pkgr) (IPI.pkgRoot ipkg) = + | Just pkgr == IPI.pkgRoot ipkg = for_ (IPI.libraryDirs ipkg) $ \libdir -> do -- When @prefix@ is not under @pkgroot@, -- @shortRelativePath prefix pkgroot@ will return a path with diff --git a/Cabal/src/Distribution/Simple/SrcDist.hs b/Cabal/src/Distribution/Simple/SrcDist.hs index d48da792fa4..8f9aca7891a 100644 --- a/Cabal/src/Distribution/Simple/SrcDist.hs +++ b/Cabal/src/Distribution/Simple/SrcDist.hs @@ -512,10 +512,7 @@ createArchive verbosity pkg_descr tmpDir targetPref = do let tarBallFilePath = targetPref tarBallName pkg_descr <.> "tar.gz" (tarProg, _) <- requireProgram verbosity tarProgram defaultProgramDb let formatOptSupported = - maybe False (== "YES") $ - Map.lookup - "Supports --format" - (programProperties tarProg) + Just "YES" == Map.lookup "Supports --format" (programProperties tarProg) runProgram verbosity tarProg $ -- Hmm: I could well be skating on thinner ice here by using the -C option -- (=> seems to be supported at least by GNU and *BSD tar) [The diff --git a/cabal-install/src/Distribution/Client/Init/Types.hs b/cabal-install/src/Distribution/Client/Init/Types.hs index f72634248a0..17f2055d878 100644 --- a/cabal-install/src/Distribution/Client/Init/Types.hs +++ b/cabal-install/src/Distribution/Client/Init/Types.hs @@ -501,7 +501,7 @@ checkInvalidPath :: String -> a -> PurePrompt a checkInvalidPath path act = -- The check below is done this way so it's easier to append -- more invalid paths in the future, if necessary - if path `elem` ["."] + if path == "." then throwPrompt $ BreakException $ "Invalid path: " ++ path else return act