-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude modules from executable #421
Comments
@andreasabel it took me a while to see what's going on here. The issue is that in your example executables:
LR:
main: LR.hs
# Exclude some files according to recipe https://github.com/sol/hpack/issues/409
when:
condition: false
other-modules:
- BugLRec
- CYK
- LBNF.ErrM
- LBNF.Skel
- LBNF.Test In places where a list of strings is expected, Hpack treats a string literal as a singleton list. It's convenient, but this issue demonstrates how this can be problematic. If would always require lists, your example would result in a parse error, which would be preferable in this case. I'm not yet sure if, and if yes what we want to do about it. Input certainly welcome! |
Ah, I see. I guess I fell into the traps because If parsing does not fail for my mistake, then it should fail in a checking phase.
But why isn't omitting the dashes a parse error in the first place?
or
if I wanted a string-literal spanning several lines. |
$ echo -e "foo:\n foo\n bar" | yaml2json -
{"foo":"foo bar"} Apparently indentation can be used to indicated continuation of a string literal.
I'm not sure what I think about doing existence checks in general as I think it collides with one of our design goals: "Give the user 100% control when needed" Possibly, we could warn if |
Or you Unfortunately, I couldn't try it myself. I searched the codebase for 30 min to find the parser for fields like Anyway, module lists/strings coming from the parser could be subjected to Which
I got one via
(But it neither seems understand the |
I think it's the one coming with the
I'm not too eager to add more syntax variation for the same thing. I'm puzzled if we could turn it into a parse error? Or possibly warn first and later make it a hard failure.
Don't worry, it will be fast for me to implement, probably faster even than doing a code review. |
Yes, this is probably better. |
Yes, I think right now something like #426 rejects spaces in module names. |
Ah, I wasn't aware of this. So basically a |
I tried to apply recipe #409 to
executables
but it does not seem to work.This is the respective section of my
package.yaml
(it does not have alibrary
section):The generated
.cabal
file still contains all these modules:hpack
seems to ignoreother-modules
in thewhen
section altogether.The text was updated successfully, but these errors were encountered: