sensei icon indicating copy to clipboard operation
sensei copied to clipboard

`sensei` chokes on `-fdefer-typed-holes`

Open soenkehahn opened this issue 9 years ago • 4 comments

Here's a script in a branch that demonstrates the bug: https://github.com/soenkehahn/quickcheck-demo/blob/sensei-bug/sensei-bug.sh

The error message is:

<interactive>: invalid argument `defer-typed-holes' for `--format'
Try `<interactive> --help' for more information.
*** Exception: ExitFailure 1

soenkehahn avatar May 16 '15 09:05 soenkehahn

This happens because -f is also a valid hspec argument. I think you can disambiguate this by putting a -- at the back, or moving the flag before the module. Say

cabal exec -- sensei-web test/Spec.hs -fdefer-typed-holes --

or

cabal exec -- sensei-web -fdefer-typed-holes test/Spec.hs

should work.

Not sure what else we should do here, but at the very least we want a better error message.

sol avatar May 16 '15 10:05 sol

I think -fwarn-no-name-shadowing works correctly though.

I wonder if it would be best to avoid any heuristic and just say that hspec arguments have to be passed after --, no exceptions. At least that behaviour would be very easy to understand and unsurprising.

soenkehahn avatar May 16 '15 13:05 soenkehahn

@soenkehahn -fno-warn-name-shadowing also does not work, just tried.

sol avatar May 22 '15 06:05 sol

I think our best bet is still to improve error messages, so that the user better understands what's going on and how he can do what he wants to do.

sol avatar May 22 '15 06:05 sol