Skip to content

Commit

Permalink
ci: Enable -Werror=compat and -Werror=default
Browse files Browse the repository at this point in the history
  • Loading branch information
langston-barrett committed Feb 26, 2025
1 parent 8a34960 commit 5ee598d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ jobs:
run: cabal check
- name: Configure
shell: bash
run: cabal configure --enable-tests
# See doc/dev.md for development practices around warnings.
run: cabal configure --enable-tests --ghc-options='-Werror=compat -Werror=default'
- name: Build
shell: bash
run: cabal build
Expand Down
15 changes: 15 additions & 0 deletions doc/dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Developer documentation

## Warnings

`parameterized-utils` is a research-grade codebase, so correctness in all cases is not *always* the highest priority.
In particular, as developers, we must weigh the cost of development practices that prioritize correctness, uniformity, or other concerns against our desire to encourage relatively rapid prototyping of interesting functionality.
When forming judgements about appropriate practices, it is worth remembering that `parameterized-utils` is also upstream of a substantial number of projects, such as What4, Crucible, and Macaw.

The developers currently judge that the warnings included in GHC's `-Wdefault` are conservative enough to be worth fixing in most cases.
Accordingly, the current default development practice is to fix instances of `-Wdefault` in new code.
However, we also trust one anothers' judgement to override this practice in any particular case.
When doing so, developers are encouraged to disable individual warnings on a per-module basis, ideally accompanied by a comment including some justification for why the warnings were not (and/or should not be) fixed.
To prevent warnings from slipping in unnoticed and thus unexamined, we enable `-Werror=default` in CI.

We also enable `-Werror=compat` in order to gradually prepare for breaking changes in GHC.
3 changes: 3 additions & 0 deletions src/Data/Parameterized/ClassesC.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ Note that there is still some ambiguity around naming conventions, see
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE TypeOperators #-}

-- See https://github.com/GaloisInc/parameterized-utils/issues/149
{-# OPTIONS_GHC -Wno-trustworthy-safe #-}

module Data.Parameterized.ClassesC
( TestEqualityC(..)
, OrdC(..)
Expand Down

0 comments on commit 5ee598d

Please sign in to comment.