diff --git a/.hlint.yaml b/.hlint.yaml index 5d0722c8fa9..2c058e5766a 100644 --- a/.hlint.yaml +++ b/.hlint.yaml @@ -3,16 +3,15 @@ - ignore: {name: "Avoid lambda"} # 51 hints - ignore: {name: "Avoid lambda using `infix`"} # 23 hints - ignore: {name: "Eta reduce"} # 138 hints -- ignore: {name: "Evaluate"} # 10 hints - ignore: {name: "Functor law"} # 10 hints - ignore: {name: "Hoist not"} # 16 hints - ignore: {name: "Monoid law, left identity"} # 3 hints - ignore: {name: "Monoid law, right identity"} # 3 hints - ignore: {name: "Move filter"} # 4 hints -- ignore: {name: "Move guards forward"} # 4 hints +- ignore: {name: "Move guards forward"} # 5 hints - ignore: {name: "Redundant $!"} # 1 hint - ignore: {name: "Redundant <$>"} # 17 hints -- ignore: {name: "Redundant bracket"} # 256 hints +- ignore: {name: "Redundant bracket"} # 257 hints - ignore: {name: "Redundant guard"} # 2 hints - ignore: {name: "Redundant if"} # 6 hints - ignore: {name: "Redundant lambda"} # 19 hints @@ -58,6 +57,8 @@ - --ignore-glob=Cabal-syntax/src/Distribution/Fields/Lexer.hs - --ignore-glob=Cabal-tests/tests/custom-setup/CabalDoctestSetup.hs - --ignore-glob=Cabal-tests/tests/custom-setup/IdrisSetup.hs + # TODO: Remove --ignore-glob for ghc-supported-languages.hs when this module compiles + - --ignore-glob=Cabal-tests/tests/misc/ghc-supported-languages.hs - --ignore-glob=cabal-testsuite/PackageTests/BuildWays/q/app/Main.hs - --ignore-glob=cabal-testsuite/PackageTests/CMain/10168/src/Lib.hs - --ignore-glob=cabal-testsuite/PackageTests/CmmSources/src/Demo.hs diff --git a/Cabal/src/Distribution/PackageDescription/Check/Target.hs b/Cabal/src/Distribution/PackageDescription/Check/Target.hs index fcf615e3069..ada37c48b22 100644 --- a/Cabal/src/Distribution/PackageDescription/Check/Target.hs +++ b/Cabal/src/Distribution/PackageDescription/Check/Target.hs @@ -640,9 +640,7 @@ checkBuildInfoExtensions bi = do , DeriveDataTypeable , ConstrainedClassMethods ] - ++ map - DisableExtension - [MonoPatBinds] + ++ [DisableExtension MonoPatBinds] -- Autogenerated modules (Paths_, PackageInfo_) checks. We could pass this -- function something more specific than the whole BuildInfo, but it would be diff --git a/Cabal/src/Distribution/Simple/Haddock.hs b/Cabal/src/Distribution/Simple/Haddock.hs index 5de73bce7ab..88d0a782135 100644 --- a/Cabal/src/Distribution/Simple/Haddock.hs +++ b/Cabal/src/Distribution/Simple/Haddock.hs @@ -1392,7 +1392,7 @@ haddockPackagePaths ipkgs mkHtmlPath = do return (flags, if null missing then Nothing else Just warning) where -- Don't warn about missing documentation for these packages. See #1231. - noHaddockWhitelist = map mkPackageName ["rts"] + noHaddockWhitelist = [mkPackageName "rts"] -- Actually extract interface and HTML paths from an 'InstalledPackageInfo'. interfaceAndHtmlPath diff --git a/Cabal/src/Distribution/Simple/Setup/Haddock.hs b/Cabal/src/Distribution/Simple/Setup/Haddock.hs index 99538accef7..f3658b7f2e7 100644 --- a/Cabal/src/Distribution/Simple/Setup/Haddock.hs +++ b/Cabal/src/Distribution/Simple/Setup/Haddock.hs @@ -511,10 +511,7 @@ haddockProjectOptions showOrParseArgs = [ option "" ["hackage"] - ( concat - [ "A short-cut option to build documentation linked to hackage." - ] - ) + "A short-cut option to build documentation linked to hackage." haddockProjectHackage (\v flags -> flags{haddockProjectHackage = v}) trueArg diff --git a/cabal-install/tests/UnitTests/Distribution/Client/Init/NonInteractive.hs b/cabal-install/tests/UnitTests/Distribution/Client/Init/NonInteractive.hs index 528e29f06a0..6e3c096467b 100644 --- a/cabal-install/tests/UnitTests/Distribution/Client/Init/NonInteractive.hs +++ b/cabal-install/tests/UnitTests/Distribution/Client/Init/NonInteractive.hs @@ -393,7 +393,7 @@ driverFunctionTest pkgIx srcDb comp = _libSourceDirs lib @?= ["src"] _libLanguage lib @?= Haskell2010 _libExposedModules lib @?= NEL.fromList (map fromString ["Foo", "Bar"]) - _libOtherModules lib @?= map fromString ["Baz.Internal"] + _libOtherModules lib @?= [fromString "Baz.Internal"] _libOtherExts lib @?= map EnableExtension [OverloadedStrings, LambdaCase, RankNTypes, RecordWildCards] _libDependencies lib @?! [] _libBuildTools lib @?= [mkStringyDep "happy:happy"] @@ -545,7 +545,7 @@ driverFunctionTest pkgIx srcDb comp = _libSourceDirs lib @?= ["src"] _libLanguage lib @?= Haskell2010 _libExposedModules lib @?= NEL.fromList (map fromString ["Foo", "Bar"]) - _libOtherModules lib @?= map fromString ["Baz.Internal"] + _libOtherModules lib @?= [fromString "Baz.Internal"] _libOtherExts lib @?= map EnableExtension [OverloadedStrings, LambdaCase, RankNTypes, RecordWildCards] _libDependencies lib @?! [] _libBuildTools lib @?= [mkStringyDep "happy:happy"] @@ -689,7 +689,7 @@ driverFunctionTest pkgIx srcDb comp = _libSourceDirs lib @?= ["src"] _libLanguage lib @?= Haskell2010 _libExposedModules lib @?= NEL.fromList (map fromString ["Foo", "Bar"]) - _libOtherModules lib @?= map fromString ["Baz.Internal"] + _libOtherModules lib @?= [fromString "Baz.Internal"] _libOtherExts lib @?= map EnableExtension [OverloadedStrings, LambdaCase, RankNTypes, RecordWildCards] _libDependencies lib @?! [] _libBuildTools lib @?= [mkStringyDep "happy:happy"] @@ -799,7 +799,7 @@ driverFunctionTest pkgIx srcDb comp = _libSourceDirs lib @?= ["src"] _libLanguage lib @?= Haskell2010 _libExposedModules lib @?= NEL.fromList (map fromString ["Foo", "Bar"]) - _libOtherModules lib @?= map fromString ["Baz.Internal"] + _libOtherModules lib @?= [fromString "Baz.Internal"] _libOtherExts lib @?= map EnableExtension [OverloadedStrings, LambdaCase, RankNTypes, RecordWildCards] _libDependencies lib @?! [] _libBuildTools lib @?= [mkStringyDep "happy:happy"] @@ -1268,7 +1268,7 @@ nonInteractiveTests pkgIx srcDb comp = [ testSimple "Library directory exists" libOtherModulesHeuristics - (map fromString ["Baz.Internal"]) + [fromString "Baz.Internal"] [ "test-package" , "True" , "[\"src/Foo.hs\", \"src/Bar.hs\", \"src/Baz/Internal.hs\"]" @@ -1447,7 +1447,7 @@ cliListParserTests = flags <- runParserTest ["-o", "Test"] flags @?= emptyFlags - { exposedModules = Flag $ map fromString ["Test"] + { exposedModules = Flag [fromString "Test"] } , testCase "Multiple exposedModules" $ do flags <- runParserTest ["-o", "Test", "-o", "Test2", "-o", "Test3"]