Skip to content

Enforce that there are no warnings in our haskell code#390

Merged
jfly merged 3 commits into
NixOS:masterfrom
jfly:fatal-warnings
May 20, 2026
Merged

Enforce that there are no warnings in our haskell code#390
jfly merged 3 commits into
NixOS:masterfrom
jfly:fatal-warnings

Conversation

@jfly
Copy link
Copy Markdown
Collaborator

@jfly jfly commented May 17, 2026

(There are multiple commits in here, I suggest reading them separately)

We had a bunch of warnings enabled, but the build would still succeed if
any of them fired. Now we have a project wide werror flag which
determines whether or not these warnings are fatal (IIUC, this is best
practice in the haskell ecosystem, as others may want to build your
project with a different version of ghc, which may emit different
warnings.

jfly added 2 commits May 17, 2026 10:52
There should be no change in behavior here.

I had to upgrade our `cabal-version` to get support for common stanzas:

```
Warning: nixfmt.cabal:63:3: Unknown field: import. You should set
cabal-version: 2.2 or larger to use common stanzas
```

I picked the newest version from
<https://cabal.readthedocs.io/en/stable/file-format-changelog.html> that
our version of cabal supports.
We had a bunch of warnings enabled, but the build would still succeed if
any of them fired. Now we have a project wide `werror` flag which
determines whether or not these warnings are fatal (IIUC, this is best
practice in the haskell ecosystem, as others may want to build your
project with a different version of ghc, which may emit different
warnings.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 17, 2026

Nixpkgs diff

Comment thread CONTRIBUTING.md Outdated
Comment thread nixfmt.cabal Outdated
Comment thread nixfmt.cabal
Comment thread CONTRIBUTING.md Outdated
This should give the best experience for new contributors, along with a
documented escape hatch for experienced contributors.

See discussion here: <NixOS#390 (comment)>
@jfly jfly requested review from MattSturgeon and dyegoaurelio May 20, 2026 16:56
@jfly jfly merged commit 3cdaf44 into NixOS:master May 20, 2026
2 checks passed
@jfly jfly deleted the fatal-warnings branch May 20, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants