Skip to content

Conversation

@phadej
Copy link
Collaborator

@phadej phadej commented Mar 10, 2023

No description provided.

@phadej phadej merged commit 1f97531 into master Mar 10, 2023
@phadej phadej deleted the missing-fields branch March 10, 2023 16:05
@ulysses4ever
Copy link

Unlike unused packages, there's no way to turn this off, is there? This is too harsh...

@phadej
Copy link
Collaborator Author

phadej commented Sep 25, 2025

@ulysses4ever error-missing-methods: none or --error-missing-methods=none.

EDIT: Or better, fix the code. My POV is those warnings ought to be errors anyway. You can always be explicit with undefined or error if you really need to no set them.

@ulysses4ever
Copy link

I can't easily fix a code that have hundreds of these.

Missing methods option isn't the same as missing fields, is it?

@phadej
Copy link
Collaborator Author

phadej commented Sep 25, 2025

They are guarded by the same configuration option.

I can't easily fix

Whether something is easy to fix or not doesn't mean that you shouldn't fix it. IMHO, if the code has hundreds of missed fields warnings, it's a bad code (and having hundreds of error "uninitialised" would highlight that). I'm sorry if haskell-ci points out that fact.

If you really want an "easy" solution, you can always "{-# OPTIONS_GHC -Wno-error-missing-fields #-}in the file. And you probably should do so to not see those hundreds of warnings by default anyway, as-Wmissing-fields is in [-Wdefault`](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/using-warnings.html#ghc-flag-Wdefault).

@phadej
Copy link
Collaborator Author

phadej commented Sep 25, 2025

Which makes me think that I also should add an option for -Werror=orphans, as all "good" code (which unfortunately has to defined orphan instances) cares to disable that warning in modules with orphans.

@ulysses4ever
Copy link

you probably should do so to not see those hundreds of warnings by default

That's a good point, thank you, I'll try that (it's still multiple modules, but it should be manageable).

They are guarded by the same configuration option.

hmm, thanks, I did not know that. It's a little confusing. But I can live with that.

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.

3 participants