mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-12-25 01:52:00 +03:00
Fixed old hlint warnings/suggestions.
This commit is contained in:
parent
758110e686
commit
7297dfab3d
@ -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.
|
||||
|
@ -1,5 +1,4 @@
|
||||
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
|
||||
{-# LANGUAGE InstanceSigs #-}
|
||||
|
||||
module ShellCommands
|
||||
( ShellCommand,
|
||||
|
@ -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
|
||||
|
@ -1,5 +1,3 @@
|
||||
{-# LANGUAGE TypeApplications #-}
|
||||
|
||||
module Wasp.Generator.DbGenerator
|
||||
( genDb,
|
||||
warnIfDbNeedsMigration,
|
||||
|
@ -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';"),
|
||||
|
@ -119,5 +119,5 @@ waspErrorRange err =
|
||||
clearMissingExtImportDiagnostics :: [WaspDiagnostic] -> [WaspDiagnostic]
|
||||
clearMissingExtImportDiagnostics = filter (not . isMissingImportDiagnostic)
|
||||
where
|
||||
isMissingImportDiagnostic (MissingExtImportDiagnostic _ _ _) = True
|
||||
isMissingImportDiagnostic MissingExtImportDiagnostic {} = True
|
||||
isMissingImportDiagnostic _ = False
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user