mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-10-26 08:57:28 +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 $>} # 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 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: 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 GeneralizedNewtypeDeriving #-}
|
||||||
{-# LANGUAGE InstanceSigs #-}
|
|
||||||
|
|
||||||
module ShellCommands
|
module ShellCommands
|
||||||
( ShellCommand,
|
( ShellCommand,
|
||||||
|
@ -73,7 +73,10 @@ runCodeAgent config codeAgent =
|
|||||||
_isGpt4Available = Nothing
|
_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 :: forall e. Exception e => e -> String
|
||||||
showShortException = shortenWithEllipsisTo 30 . displayException
|
showShortException = shortenWithEllipsisTo 30 . displayException
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
{-# LANGUAGE TypeApplications #-}
|
|
||||||
|
|
||||||
module Wasp.Generator.DbGenerator
|
module Wasp.Generator.DbGenerator
|
||||||
( genDb,
|
( genDb,
|
||||||
warnIfDbNeedsMigration,
|
warnIfDbNeedsMigration,
|
||||||
|
@ -9,7 +9,7 @@ spec_PageComponentFileTest :: Spec
|
|||||||
spec_PageComponentFileTest = do
|
spec_PageComponentFileTest = do
|
||||||
describe "getPageComponentFileContentWithFixedImports" $ do
|
describe "getPageComponentFileContentWithFixedImports" $ do
|
||||||
let mockAllPossibleWaspClientImports =
|
let mockAllPossibleWaspClientImports =
|
||||||
M.fromList $
|
M.fromList
|
||||||
[ ("useQuery", "import { useQuery } from '@wasp/queries';"),
|
[ ("useQuery", "import { useQuery } from '@wasp/queries';"),
|
||||||
("useAction", "import { useAction } from '@wasp/actions';"),
|
("useAction", "import { useAction } from '@wasp/actions';"),
|
||||||
("useAuth", "import useAuth from '@wasp/auth/useAuth';"),
|
("useAuth", "import useAuth from '@wasp/auth/useAuth';"),
|
||||||
|
@ -119,5 +119,5 @@ waspErrorRange err =
|
|||||||
clearMissingExtImportDiagnostics :: [WaspDiagnostic] -> [WaspDiagnostic]
|
clearMissingExtImportDiagnostics :: [WaspDiagnostic] -> [WaspDiagnostic]
|
||||||
clearMissingExtImportDiagnostics = filter (not . isMissingImportDiagnostic)
|
clearMissingExtImportDiagnostics = filter (not . isMissingImportDiagnostic)
|
||||||
where
|
where
|
||||||
isMissingImportDiagnostic (MissingExtImportDiagnostic _ _ _) = True
|
isMissingImportDiagnostic MissingExtImportDiagnostic {} = True
|
||||||
isMissingImportDiagnostic _ = False
|
isMissingImportDiagnostic _ = False
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
{-# LANGUAGE FlexibleInstances #-}
|
{-# LANGUAGE FlexibleInstances #-}
|
||||||
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
|
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
|
||||||
{-# LANGUAGE TypeSynonymInstances #-}
|
|
||||||
|
|
||||||
module Wasp.LSP.ServerMonads
|
module Wasp.LSP.ServerMonads
|
||||||
( -- * LSP Server Monads
|
( -- * LSP Server Monads
|
||||||
@ -106,6 +105,8 @@ sendToReactor act = do
|
|||||||
rin <- handler $ asks (^. reactorIn)
|
rin <- handler $ asks (^. reactorIn)
|
||||||
liftIO $ atomically $ writeTChan rin $ ReactorAction $ LSP.runLspT env $ runRLspM stateTVar act
|
liftIO $ atomically $ writeTChan rin $ ReactorAction $ LSP.runLspT env $ runRLspM stateTVar act
|
||||||
|
|
||||||
|
{- HLINT ignore "Redundant <$>" -}
|
||||||
|
|
||||||
instance HasProjectRootDir HandlerM where
|
instance HasProjectRootDir HandlerM where
|
||||||
-- Returns the folder that contains the active .wasp file, which is assumed
|
-- Returns the folder that contains the active .wasp file, which is assumed
|
||||||
-- to be the root of the wasp project.
|
-- to be the root of the wasp project.
|
||||||
|
Loading…
Reference in New Issue
Block a user