Skip to content

chore: enable more GHC warnings#336

Merged
cgeorgii merged 4 commits intomainfrom
gipphe/chore-enable-more-ghc-warnings
Mar 18, 2026
Merged

chore: enable more GHC warnings#336
cgeorgii merged 4 commits intomainfrom
gipphe/chore-enable-more-ghc-warnings

Conversation

@Gipphe
Copy link
Collaborator

@Gipphe Gipphe commented Mar 18, 2026

Use -Weverything and selectively disable warnings we don't want instead of using -Wall and adding missing ones.

Warnings worth mentioning:

  • -Wderiving-typeable: Typeable is now automatically derived for all types in Haskell since GHC 7.10. Explicitly deriving it in a deriving clause is redundant.
  • -Wmissing-deriving-strategies: Makes it more explicit how we are deriving instances for all types. Adds a bit of overhead, but makes it more explicit how instances are derived by enforcing the stock, newtype, anyclass or via strategies to be stated.
  • -Wunused-packages: We would normally like to enable this by default, but currently base and tasty-discover are considered "unused" by it, and are thus falsely flagged. This creates unnecessary noise in the compiler output, so it is wise to instead use this on a "by need" basis instead.

Some other warnings we instead explicitly disable. The reason for disabling each of them is stated in a comment next to the respective GHC option flag.

@Gipphe Gipphe force-pushed the gipphe/chore-enable-more-ghc-warnings branch from a6e4204 to 0bdd85b Compare March 18, 2026 13:59
@Gipphe Gipphe marked this pull request as ready for review March 18, 2026 14:03
@Gipphe Gipphe requested review from cgeorgii and prednaz March 18, 2026 14:03
@Gipphe Gipphe force-pushed the gipphe/chore-enable-more-ghc-warnings branch from 0bdd85b to ffa9077 Compare March 18, 2026 14:05
Some exceptions have to be made for `base` and `tasty-discover` though.
@Gipphe Gipphe force-pushed the gipphe/chore-enable-more-ghc-warnings branch from ffa9077 to 8bcbbfb Compare March 18, 2026 14:05
Copy link
Member

@cgeorgii cgeorgii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff, thanks!

@cgeorgii cgeorgii added this pull request to the merge queue Mar 18, 2026
Merged via the queue into main with commit 898f759 Mar 18, 2026
2 checks passed
@cgeorgii cgeorgii deleted the gipphe/chore-enable-more-ghc-warnings branch March 18, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants