Skip to content

Commit

Permalink
Activate more warnings, including Wunused-packages for GHC 8.10+
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentRDC committed Jan 11, 2025
1 parent 5829a80 commit ea48db3
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 6 deletions.
5 changes: 5 additions & 0 deletions beam-core/beam-core.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,13 @@ library
DefaultSignatures, KindSignatures, MultiParamTypeClasses, DeriveGeneric, DeriveFunctor, DeriveDataTypeable,
TypeApplications, FunctionalDependencies, DataKinds, BangPatterns, InstanceSigs
ghc-options: -Wall
-Widentities
-Wincomplete-uni-patterns
-Wincomplete-record-updates
if impl(ghc >= 8.8)
ghc-options: -Wcompat
if impl(ghc >= 8.10)
ghc-options: -Wunused-packages
if flag(werror)
ghc-options: -Werror
if impl(ghc >= 8.10)
Expand Down
8 changes: 7 additions & 1 deletion beam-migrate/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Unreleased

## Dependencies

* Removed explicit dependency on `ghc-prim`, which was not used directly.

# 0.5.3.1

## Bug fixes
Expand All @@ -18,7 +24,7 @@

# 0.5.2.0

## Addded features
## Added features

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

Expand Down
4 changes: 2 additions & 2 deletions beam-migrate/Database/Beam/Migrate/Actions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ addColumnProvider =
pure (PotentialAction mempty (HS.fromList ([SomeDatabasePredicate colP] ++ constraintsP))
(Seq.singleton (MigrationCommand cmd MigrationKeepsData))
("Add column " <> colNm <> " to " <> qnameAsText tblNm)
(addColumnWeight + fromIntegral (T.length (qnameAsText tblNm) + T.length colNm)))
(addColumnWeight + (T.length (qnameAsText tblNm) + T.length colNm)))

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

-- | Action provider for SQL92 @ALTER TABLE ... ALTER COLUMN ... SET NULL@
addColumnNullProvider :: forall be
Expand Down
6 changes: 5 additions & 1 deletion beam-migrate/beam-migrate.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ library
microlens >=0.4 && <0.5,
parallel >=3.2 && <3.3,
deepseq >=1.4 && <1.7,
ghc-prim >=0.5 && <0.14,
haskell-src-exts >=1.18 && <1.24,
pretty >=1.1 && <1.2,
dependent-map >=0.2 && <0.5,
Expand All @@ -82,8 +81,13 @@ library
FlexibleInstances, TypeOperators, TypeApplications, MultiParamTypeClasses,
DataKinds, DeriveGeneric
ghc-options: -Wall
-Widentities
-Wincomplete-uni-patterns
-Wincomplete-record-updates
if flag(werror)
ghc-options: -Werror
if impl(ghc >= 8.10)
ghc-options: -Wunused-packages

flag werror
description: Enable -Werror during development
Expand Down
5 changes: 5 additions & 0 deletions beam-postgres/beam-postgres.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ library
DeriveDataTypeable, DeriveGeneric, StandaloneDeriving, TypeFamilies, GADTs, OverloadedStrings,
CPP, TypeApplications, FlexibleContexts
ghc-options: -Wall
-Widentities
-Wincomplete-uni-patterns
-Wincomplete-record-updates
if impl(ghc >= 8.10)
ghc-options: -Wunused-packages
if flag(werror)
ghc-options: -Werror

Expand Down
2 changes: 1 addition & 1 deletion beam-sqlite/Database/Beam/Sqlite/Syntax.hs
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ instance HasSqlValueSyntax SqliteValueSyntax Int16 where
instance HasSqlValueSyntax SqliteValueSyntax Int32 where
sqlValueSyntax i = SqliteValueSyntax (emitValue (SQLInteger (fromIntegral i)))
instance HasSqlValueSyntax SqliteValueSyntax Int64 where
sqlValueSyntax i = SqliteValueSyntax (emitValue (SQLInteger (fromIntegral i)))
sqlValueSyntax i = SqliteValueSyntax (emitValue (SQLInteger i))
instance HasSqlValueSyntax SqliteValueSyntax Word8 where
sqlValueSyntax i = SqliteValueSyntax (emitValue (SQLInteger (fromIntegral i)))
instance HasSqlValueSyntax SqliteValueSyntax Word16 where
Expand Down
7 changes: 6 additions & 1 deletion beam-sqlite/beam-sqlite.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,13 @@ library
DeriveDataTypeable, DeriveGeneric, StandaloneDeriving, TypeFamilies, GADTs, OverloadedStrings,
CPP, TypeApplications, FlexibleContexts, ConstraintKinds, DerivingStrategies
ghc-options: -Wall
-Widentities
-Wincomplete-uni-patterns
-Wincomplete-record-updates
if impl(ghc >= 8.10)
ghc-options: -Wunused-packages
if flag(werror)
ghc-options: -Werror
ghc-options: -Werror

test-suite beam-sqlite-tests
type: exitcode-stdio-1.0
Expand Down

0 comments on commit ea48db3

Please sign in to comment.