speced / bikeshed

:bike: A preprocessor for anyone writing specifications that converts source files into actual specs.

Home Page:https://speced.github.io/bikeshed

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bikeshed watch vs. die on: warning in metadata

inexorabletash opened this issue · comments

If a spec has Die On: warning (etc) in the metadata, then when using bikeshed watch (or bikeshed serve) the watch loop exits on any warning (etc). This is unexpected to me; given that the use case is to allow editing with a simple save->refresh cycle, I'd expect the warnings to be spewed on the console and the loop to continue but the file wouldn't be rewritten (or maybe the file should be replaced by a "generation failed" page, in case the user isn't watching the console and wonders why the page didn't update?)

I tried overriding the metadata with --die-on=nothing / --force on the command line but that didn't seem to work. Am I doing it wrong?

I believe this has always been the case with fatal errors, which in hindsight was also contrary to the use case for bikeshed watch, but now that Die On: warning is supported in the metadata the problem is more apparent.

The workaround is to "comment out" the metadata line, but that is error prone.

Digging into the code (handleWatch, handleServe) there's explicit m.state.dieOn = "nothing" but that's getting overridden in the processing of the Die On metadata.

Oooh! Yeah, this definitely worked before; fatal errors didn't stop processing. I just didn't correctly handle the changes when I switched the handling of metadata here.