serokell / universum

:milky_way: Prelude written in @Serokell
MIT License
176 stars 26 forks source link

[#185] Enable more warnings and fix them #218

Closed gromakovsky closed 4 years ago

gromakovsky commented 4 years ago

Description

Here I enable all warnings that I find sane, enable -Werror and fix new warnings.

Related issues(s)

Fixed #185.

✓ Checklist for your Pull Request

Ideally a PR has all of the checkmarks set.

If something in this list is irrelevant to your PR, you should still set this checkmark indicating that you are sure it is dealt with (be that by irrelevance).

Related changes (conditional)

Stylistic guide (mandatory)

int-index commented 4 years ago

It's better to enable -Werror on CI only instead of always, otherwise development and building on newer GHC versions with allow-newer: True becomes difficult.

gromakovsky commented 4 years ago

I can add a Makefile which would pass --ghc-options -Wwarn. In this case if we switch to another CI we won't accidentally forget to enable -Werror.

int-index commented 4 years ago

Imagine there's a package x which depends on universum. How would it disable -Werror? Passing -Wwarn would only affect x itself, and having a Makefile for universum would not be helpful at all.

gromakovsky commented 4 years ago

Does --ghc-options -Werror in universum.cabal matter when one builds x? I thought no, but if it matters then yes, probably it's better to do it differently.

int-index commented 4 years ago

Does --ghc-options -Werror in universum.cabal matter when one builds x?

Yes. ghc-options from the .cabal file are in effect if the package is being built as a dependency of another package (why would they be ignored?)

gromakovsky commented 4 years ago

Ok, now it's different.