summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2024-05-01 22:35:36 -0400
committerBen Sima <ben@bsima.me>2024-05-09 21:38:52 -0400
commit2fac80aa1727a200f576f899bb325f523842c3ff (patch)
tree66668874a8e7a546473ba66d1159cf36c9751dc5
parentd71c6f8c5955e8a9861e3f3957b293a369aac954 (diff)
Turn on more Haskell errors
I actually thought these were turned on, but found that they weren't when I was investigating Haddock stuff. There aren't many violations, so I just turned them on and fixed the violations real quick.
-rw-r--r--Alpha.hs1
-rw-r--r--Biz/Bild.hs5
-rw-r--r--Biz/Bild.nix3
-rw-r--r--Biz/Bild/Deps.hs2
-rw-r--r--Biz/Dragons.hs5
-rw-r--r--Biz/Que/Host.hs2
-rw-r--r--Biz/Que/Site.hs6
7 files changed, 16 insertions, 8 deletions
diff --git a/Alpha.hs b/Alpha.hs
index 4f672fc..32b3137 100644
--- a/Alpha.hs
+++ b/Alpha.hs
@@ -1,5 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoImplicitPrelude #-}
+{-# OPTIONS_GHC -fno-warn-orphans #-}
-- | Commonly useful functions, a Prelude replacement.
--
diff --git a/Biz/Bild.hs b/Biz/Bild.hs
index bae0328..5c8e287 100644
--- a/Biz/Bild.hs
+++ b/Biz/Bild.hs
@@ -612,7 +612,10 @@ analyze hmap ns = case Map.lookup ns hmap of
packageSet = "haskell.packages",
mainModule = Namespace.toModule namespace,
compilerFlags =
- [ "-Werror",
+ [ "-Wall",
+ "-Werror",
+ "-haddock",
+ "-Winvalid-haddock",
"-threaded",
"-i$CODEROOT",
"-odir",
diff --git a/Biz/Bild.nix b/Biz/Bild.nix
index c6e2f27..859d070 100644
--- a/Biz/Bild.nix
+++ b/Biz/Bild.nix
@@ -111,6 +111,9 @@ let
ghc \
-threaded \
-Werror \
+ -Wall \
+ -Winvalid-haddock \
+ -haddock \
-i. \
--make Biz/Bild.hs \
-main-is Biz.Bild \
diff --git a/Biz/Bild/Deps.hs b/Biz/Bild/Deps.hs
index 0b57a4f..2b2a72a 100644
--- a/Biz/Bild/Deps.hs
+++ b/Biz/Bild/Deps.hs
@@ -69,7 +69,7 @@ cli args = do
execParserPure' pprefs pinfo [] =
Opts.Failure
<| Opts.parserFailure pprefs pinfo (Opts.ShowHelpText Nothing) mempty
- execParserPure' pprefs pinfo args = Opts.execParserPure pprefs pinfo args
+ execParserPure' pprefs pinfo args_ = Opts.execParserPure pprefs pinfo args_
opts = Opts.info ((,) </ ((,) </ parseFindSourcesJson <*> parseColors) <*> (parseCommand <**> Opts.helper)) <| mconcat desc
desc =
[ Opts.fullDesc,
diff --git a/Biz/Dragons.hs b/Biz/Dragons.hs
index 7e626da..4497f8e 100644
--- a/Biz/Dragons.hs
+++ b/Biz/Dragons.hs
@@ -77,7 +77,6 @@ import NeatInterpolation
import qualified Network.Wai as Wai
import qualified Network.Wai.Handler.Warp as Warp
import Servant
-import Servant.API.Generic (ToServantApi, genericApi, toServant, (:-))
import qualified Servant.Auth as Auth
import qualified Servant.Auth.Server as Auth
import qualified Servant.HTML.Lucid as Lucid
@@ -743,7 +742,9 @@ startup quiet = do
oAuthArgs <- Envy.decodeWithDefaults Envy.defConfig
kp <- Acid.openLocalStateFrom (keep cfg) init :: IO (Acid.AcidState Keep)
jwk <- Auth.generateKey -- TODO: store this in a file somewhere
- let ForgeURL url = homeExample cfg
+ let url = case homeExample cfg of
+ ForgeURL u -> u
+ CLISubmission -> "<CLISubmission>"
unless quiet <| do
Log.info ["boot", "dragons"] >> Log.br
Log.info ["boot", "area", show <| area cfg] >> Log.br
diff --git a/Biz/Que/Host.hs b/Biz/Que/Host.hs
index f1b986c..da424df 100644
--- a/Biz/Que/Host.hs
+++ b/Biz/Que/Host.hs
@@ -38,8 +38,6 @@ import qualified Data.HashMap.Lazy as HashMap
import Network.HTTP.Media ((//), (/:))
import qualified Network.Wai.Handler.Warp as Warp
import Servant
-import Servant.API.Generic ((:-))
--- import qualified Servant.Auth.Server as Auth
import Servant.Server.Generic (AsServerT, genericServeT)
import qualified Servant.Types.SourceT as Source
import qualified System.Envy as Envy
diff --git a/Biz/Que/Site.hs b/Biz/Que/Site.hs
index e027717..7151cd0 100644
--- a/Biz/Que/Site.hs
+++ b/Biz/Que/Site.hs
@@ -31,7 +31,9 @@ main = Cli.main <| Cli.Plan help move test pure
move :: Cli.Arguments -> IO ()
move args = do
- let (Just src, Just ns) = (getArg "src", Text.pack </ getArg "ns")
+ let (src, ns) = case (getArg "src", Text.pack </ getArg "ns") of
+ (Just s, Just n) -> (s, n)
+ _ -> panic "could not initialize from CLI arguments"
mKey <- getKey ns
putText <| "serving " <> Text.pack src <> " at " <> ns
run mKey ns
@@ -132,7 +134,7 @@ serve Nothing "pub" path content =
mempty
liftIO <| pure ()
serve Nothing p _ _ = panic <| "no auth key provided for ns: " <> p
-serve (Just key) ns path content =
+serve (Just _) ns path content =
runReq defaultHttpConfig <| do
let options =
header "Content-type" "text/html;charset=utf-8"