diff --git a/bikeshed/cli.py b/bikeshed/cli.py index f4759b9f06..464d73e501 100644 --- a/bikeshed/cli.py +++ b/bikeshed/cli.py @@ -556,8 +556,6 @@ def handleWatch(options: argparse.Namespace, extras: list[str]) -> None: from . import metadata from .Spec import Spec - # Can't have an error killing the watcher - m.state.dieOn = "nothing" doc = Spec(inputFilename=options.infile, token=options.ghToken) if not doc.valid: m.die("Spec is in an invalid state; exitting.") @@ -572,12 +570,13 @@ def handleServe(options: argparse.Namespace, extras: list[str]) -> None: from . import metadata from .Spec import Spec - m.state.dieOn = "nothing" doc = Spec(inputFilename=options.infile, token=options.ghToken) if not doc.valid: m.die("Spec is in an invalid state; exitting.") return doc.mdCommandLine = metadata.fromCommandLine(extras) + # Can't have an error killing the watcher + doc.mdCommandLine.addData("Die On", "nothing") if options.byos: doc.mdCommandLine.addData("Group", "byos") doc.watch(outputFilename=options.outfile, port=int(options.port)) diff --git a/bikeshed/messages.py b/bikeshed/messages.py index 2b9b532450..92dbe75468 100644 --- a/bikeshed/messages.py +++ b/bikeshed/messages.py @@ -58,6 +58,8 @@ def replace(self, **kwargs: t.Any) -> MessagesState: return dataclasses.replace(self, seenMessages=set(), categoryCounts=Counter(), **kwargs) def shouldDie(self, category: str, timing: str = "early") -> bool: + if self.dieWhen == "never": + return False if self.dieWhen == "late" and timing == "early": return False deathLevel = MESSAGE_LEVELS[self.dieOn]