about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2019-11-30T23·16-0500
committerGriffin Smith <root@gws.fyi>2019-11-30T23·16-0500
commit0b22bb099c9f2254d16784e5897b18e9e410c2fa (patch)
tree295a1781a95e6f435b7c5469de13144fbace9a74
parent97a5c61f28ba98728bab390e0ea745edfbea7103 (diff)
Fail on all warnings in CI
All the undefineds are gone, so it's time to enable -Werror in CI.
-rwxr-xr-x.github/actions/nix-build/entrypoint.sh2
-rw-r--r--.github/workflows/haskell.yml2
-rw-r--r--default.nix16
-rw-r--r--src/Xanthous/App.hs4
-rw-r--r--src/Xanthous/Util/QuickCheck.hs1
5 files changed, 14 insertions, 11 deletions
diff --git a/.github/actions/nix-build/entrypoint.sh b/.github/actions/nix-build/entrypoint.sh
index 4499660edd32..cb7aca541a3f 100755
--- a/.github/actions/nix-build/entrypoint.sh
+++ b/.github/actions/nix-build/entrypoint.sh
@@ -16,7 +16,7 @@ file="$1"
 [ ! -e "$file" ] && echo "File $file not exist!" && exit 1
 
 echo "Building all attrs in $file..."
-nix-build --no-link ${QUIET_ARG} "$file"
+nix-build --no-link ${QUIET_ARG} "$file" "${@:2}"
 
 echo "Copying build closure to $(pwd)/store..."
 mapfile -t storePaths < <(nix-build ${QUIET_ARG} --no-link "$file" | grep -v cache-deps)
diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml
index e1a57d44005e..df82de3e8caf 100644
--- a/.github/workflows/haskell.yml
+++ b/.github/workflows/haskell.yml
@@ -11,5 +11,5 @@ jobs:
     - uses: actions/checkout@v1
     - name: Nix Build
       with:
-        args: default.nix
+        args: default.nix --arg failOnWarnings true
       uses: ./.github/actions/nix-build
diff --git a/default.nix b/default.nix
index ca163c8e56d7..a341398509d8 100644
--- a/default.nix
+++ b/default.nix
@@ -1,11 +1,15 @@
 { nixpkgs ? import ./nixpkgs.nix {}
-, compiler ? "ghc865" }:
+, compiler ? "ghc865"
+, failOnWarnings ? false
+}:
 let
-  inherit (nixpkgs) pkgs;
+  inherit (nixpkgs) pkgs lib;
+  inherit (lib) id;
   all-hies = import (fetchTarball "https://github.com/infinisil/all-hies/tarball/master") {};
   hie = all-hies.selection { selector = p: { inherit (p) ghc865; }; };
-  xanthous = (pkgs.haskellPackages
-    .extend (import ./haskell-overlay.nix { inherit nixpkgs; }))
-    .callPackage (import ./pkg.nix { inherit nixpkgs; }) {};
-in
+  xanthous =
+    (if failOnWarnings then pkgs.haskell.lib.failOnAllWarnings else id)
+      ((pkgs.haskellPackages
+      .extend (import ./haskell-overlay.nix { inherit nixpkgs; })
+    ).callPackage (import ./pkg.nix { inherit nixpkgs; }) {}); in
 xanthous // { inherit hie; }
diff --git a/src/Xanthous/App.hs b/src/Xanthous/App.hs
index 76e03e860999..b8cda3b77721 100644
--- a/src/Xanthous/App.hs
+++ b/src/Xanthous/App.hs
@@ -411,5 +411,5 @@ entityMenu_ = mkMenuItems @[_] . map entityMenuItem
            then ec
            else 'a'
 
-entityMenu :: Entity entity => [entity] -> Map Char (MenuOption entity)
-entityMenu = map (map runIdentity) . entityMenu_ . fmap Identity
+-- entityMenu :: Entity entity => [entity] -> Map Char (MenuOption entity)
+-- entityMenu = map (map runIdentity) . entityMenu_ . fmap Identity
diff --git a/src/Xanthous/Util/QuickCheck.hs b/src/Xanthous/Util/QuickCheck.hs
index ba04f9ffb28f..be12bc294513 100644
--- a/src/Xanthous/Util/QuickCheck.hs
+++ b/src/Xanthous/Util/QuickCheck.hs
@@ -14,7 +14,6 @@ import Test.QuickCheck.Function
 import Test.QuickCheck.Instances.ByteString ()
 import Test.QuickCheck.Arbitrary.Generic
 import Data.Aeson
-import Data.Coerce
 import GHC.Generics (Rep)
 --------------------------------------------------------------------------------