Closed amesgen closed 4 years ago
Ping @neongreen.
I'm fixing it now.
To be clear: Ormolu did not complain about unrecognized GHC options before either. What happens here, I think, is that those options end up in the "leftover list", second element of 3-tuple returned by parseDynamicFilePragma
.
Ah makes sense, I did not check the previous behavior. Whether a non empty leftover list should be reported might be worth considering (but I don't think it is of great importance).
I'm going to make unrecognized options cause Ormolu to fail. It's no good swallowing them, we only introduce a possibility for subtle bugs and hard-to-debug problems this way. If an option doesn't make sense, it should be reported.
GHC options passed via
--ghc-opt
have been ignored since #423.I think this code has not been ported.
Changing
parseModule
like this seems to work (but invalid GHC options are not reported - supposedly it has to be wrapped withcatchErrors
fromparsePragmasIntoDynFlags
?):