Skip to content

Commit ea48db3

Browse files
committed
Activate more warnings, including Wunused-packages for GHC 8.10+
1 parent 5829a80 commit ea48db3

File tree

7 files changed

+31
-6
lines changed

7 files changed

+31
-6
lines changed

beam-core/beam-core.cabal

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,13 @@ library
8484
DefaultSignatures, KindSignatures, MultiParamTypeClasses, DeriveGeneric, DeriveFunctor, DeriveDataTypeable,
8585
TypeApplications, FunctionalDependencies, DataKinds, BangPatterns, InstanceSigs
8686
ghc-options: -Wall
87+
-Widentities
88+
-Wincomplete-uni-patterns
89+
-Wincomplete-record-updates
8790
if impl(ghc >= 8.8)
8891
ghc-options: -Wcompat
92+
if impl(ghc >= 8.10)
93+
ghc-options: -Wunused-packages
8994
if flag(werror)
9095
ghc-options: -Werror
9196
if impl(ghc >= 8.10)

beam-migrate/ChangeLog.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Unreleased
2+
3+
## Dependencies
4+
5+
* Removed explicit dependency on `ghc-prim`, which was not used directly.
6+
17
# 0.5.3.1
28

39
## Bug fixes
@@ -18,7 +24,7 @@
1824

1925
# 0.5.2.0
2026

21-
## Addded features
27+
## Added features
2228

2329
* `IN (SELECT ...)` syntax via `inSelectE`
2430

beam-migrate/Database/Beam/Migrate/Actions.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ addColumnProvider =
440440
pure (PotentialAction mempty (HS.fromList ([SomeDatabasePredicate colP] ++ constraintsP))
441441
(Seq.singleton (MigrationCommand cmd MigrationKeepsData))
442442
("Add column " <> colNm <> " to " <> qnameAsText tblNm)
443-
(addColumnWeight + fromIntegral (T.length (qnameAsText tblNm) + T.length colNm)))
443+
(addColumnWeight + (T.length (qnameAsText tblNm) + T.length colNm)))
444444

445445
-- | Action provider for SQL92 @ALTER TABLE ... DROP COLUMN ...@ actions
446446
dropColumnProvider :: forall be
@@ -469,7 +469,7 @@ dropColumnProvider = ActionProvider provider
469469
pure (PotentialAction (HS.fromList (SomeDatabasePredicate colP:relatedPreds)) mempty
470470
(Seq.singleton (MigrationCommand cmd MigrationLosesData))
471471
("Drop column " <> colNm <> " from " <> qnameAsText tblNm)
472-
(dropColumnWeight + fromIntegral (T.length (qnameAsText tblNm) + T.length colNm)))
472+
(dropColumnWeight + (T.length (qnameAsText tblNm) + T.length colNm)))
473473

474474
-- | Action provider for SQL92 @ALTER TABLE ... ALTER COLUMN ... SET NULL@
475475
addColumnNullProvider :: forall be

beam-migrate/beam-migrate.cabal

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ library
6969
microlens >=0.4 && <0.5,
7070
parallel >=3.2 && <3.3,
7171
deepseq >=1.4 && <1.7,
72-
ghc-prim >=0.5 && <0.14,
7372
haskell-src-exts >=1.18 && <1.24,
7473
pretty >=1.1 && <1.2,
7574
dependent-map >=0.2 && <0.5,
@@ -82,8 +81,13 @@ library
8281
FlexibleInstances, TypeOperators, TypeApplications, MultiParamTypeClasses,
8382
DataKinds, DeriveGeneric
8483
ghc-options: -Wall
84+
-Widentities
85+
-Wincomplete-uni-patterns
86+
-Wincomplete-record-updates
8587
if flag(werror)
8688
ghc-options: -Werror
89+
if impl(ghc >= 8.10)
90+
ghc-options: -Wunused-packages
8791

8892
flag werror
8993
description: Enable -Werror during development

beam-postgres/beam-postgres.cabal

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ library
6666
DeriveDataTypeable, DeriveGeneric, StandaloneDeriving, TypeFamilies, GADTs, OverloadedStrings,
6767
CPP, TypeApplications, FlexibleContexts
6868
ghc-options: -Wall
69+
-Widentities
70+
-Wincomplete-uni-patterns
71+
-Wincomplete-record-updates
72+
if impl(ghc >= 8.10)
73+
ghc-options: -Wunused-packages
6974
if flag(werror)
7075
ghc-options: -Werror
7176

beam-sqlite/Database/Beam/Sqlite/Syntax.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ instance HasSqlValueSyntax SqliteValueSyntax Int16 where
710710
instance HasSqlValueSyntax SqliteValueSyntax Int32 where
711711
sqlValueSyntax i = SqliteValueSyntax (emitValue (SQLInteger (fromIntegral i)))
712712
instance HasSqlValueSyntax SqliteValueSyntax Int64 where
713-
sqlValueSyntax i = SqliteValueSyntax (emitValue (SQLInteger (fromIntegral i)))
713+
sqlValueSyntax i = SqliteValueSyntax (emitValue (SQLInteger i))
714714
instance HasSqlValueSyntax SqliteValueSyntax Word8 where
715715
sqlValueSyntax i = SqliteValueSyntax (emitValue (SQLInteger (fromIntegral i)))
716716
instance HasSqlValueSyntax SqliteValueSyntax Word16 where

beam-sqlite/beam-sqlite.cabal

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,13 @@ library
4747
DeriveDataTypeable, DeriveGeneric, StandaloneDeriving, TypeFamilies, GADTs, OverloadedStrings,
4848
CPP, TypeApplications, FlexibleContexts, ConstraintKinds, DerivingStrategies
4949
ghc-options: -Wall
50+
-Widentities
51+
-Wincomplete-uni-patterns
52+
-Wincomplete-record-updates
53+
if impl(ghc >= 8.10)
54+
ghc-options: -Wunused-packages
5055
if flag(werror)
51-
ghc-options: -Werror
56+
ghc-options: -Werror
5257

5358
test-suite beam-sqlite-tests
5459
type: exitcode-stdio-1.0

0 commit comments

Comments
 (0)