Fixed old hlint warnings/suggestions.

This commit is contained in:
Martin Sosic 2024-01-08 15:54:10 +01:00
parent 758110e686
commit 7297dfab3d
7 changed files with 9 additions and 7 deletions

View File

@ -12,3 +12,4 @@
- ignore: {name: Use $>} # I find it makes code harder to read if enforced.
- ignore: {name: Use list comprehension} # We can decide this on our own.
- ignore: {name: Use ++} # I sometimes prefer concat over ++ due to the nicer formatting / extensibility.
- ignore: {name: Redundant lambda} # Sometimes it is nicer to create explicit lambda then function.

View File

@ -1,5 +1,4 @@
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE InstanceSigs #-}
module ShellCommands
( ShellCommand,

View File

@ -73,7 +73,10 @@ runCodeAgent config codeAgent =
_isGpt4Available = Nothing
}
shortenWithEllipsisTo maxLen text = if length text <= maxLen then text else (take maxLen text) <> "..."
shortenWithEllipsisTo maxLen text =
if length text <= maxLen
then text
else take maxLen text <> "..."
showShortException :: forall e. Exception e => e -> String
showShortException = shortenWithEllipsisTo 30 . displayException

View File

@ -1,5 +1,3 @@
{-# LANGUAGE TypeApplications #-}
module Wasp.Generator.DbGenerator
( genDb,
warnIfDbNeedsMigration,

View File

@ -9,7 +9,7 @@ spec_PageComponentFileTest :: Spec
spec_PageComponentFileTest = do
describe "getPageComponentFileContentWithFixedImports" $ do
let mockAllPossibleWaspClientImports =
M.fromList $
M.fromList
[ ("useQuery", "import { useQuery } from '@wasp/queries';"),
("useAction", "import { useAction } from '@wasp/actions';"),
("useAuth", "import useAuth from '@wasp/auth/useAuth';"),

View File

@ -119,5 +119,5 @@ waspErrorRange err =
clearMissingExtImportDiagnostics :: [WaspDiagnostic] -> [WaspDiagnostic]
clearMissingExtImportDiagnostics = filter (not . isMissingImportDiagnostic)
where
isMissingImportDiagnostic (MissingExtImportDiagnostic _ _ _) = True
isMissingImportDiagnostic MissingExtImportDiagnostic {} = True
isMissingImportDiagnostic _ = False

View File

@ -1,6 +1,5 @@
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE TypeSynonymInstances #-}
module Wasp.LSP.ServerMonads
( -- * LSP Server Monads
@ -106,6 +105,8 @@ sendToReactor act = do
rin <- handler $ asks (^. reactorIn)
liftIO $ atomically $ writeTChan rin $ ReactorAction $ LSP.runLspT env $ runRLspM stateTVar act
{- HLINT ignore "Redundant <$>" -}
instance HasProjectRootDir HandlerM where
-- Returns the folder that contains the active .wasp file, which is assumed
-- to be the root of the wasp project.