NorfairKing / sydtest

A modern testing framework for Haskell with good defaults and advanced testing features.
113 stars 25 forks source link

hard-coded prepositive qualification in the discover utility #54

Closed temyurchenko closed 2 years ago

temyurchenko commented 2 years ago

Enabling -Wprepositive-qualified-module -Werror breaks the discover utility.

It uses prepositive qualified in several places, like here and here.

Not sure, how to solve it. A workaroundy way would be to allow specifying this as an -optF argument. A better way would be to deduce this automatically by looking at the list of enabled extensions. I haven't researched this though yet.

If you give me a hint, I can try to fix this.

temyurchenko commented 2 years ago

The better fix would probably look similar to the one found here.

NorfairKing commented 2 years ago

I guess we could get rid of qualified in the generate code and just use complete qualification for everything in the generated code. Would that work for you?

temyurchenko commented 2 years ago

That's one way to do it, but given how warnings are always unknown and can be extended with new compiler settings, and can create vastly different requirements for the generated code, we probably don't want to conform to them. I might be mistaken, but it seems that generally warnings help in building correct programs and guard from programmer's mistakes. The generated code is correct by construction (if the construction algorithm is correct, which may only be checked once). So, there isn't as much value in keeping the same warnings for the generated files. So, another solution would be to disable all warnings and enable a known subset of them in a file-local fashion via a pragma. What do you think about it?

NorfairKing commented 2 years ago

@murcake You make a good point. I think we should probably do both: Turn off -Wall warnings AND remove qualifications.

NorfairKing commented 2 years ago

@murcake I was wrong, just doing the warning thing you described is the way to go in my revised opinion. See #55