Closed matmilbury closed 8 months ago
Temporary workaround:
Foo
└── It reverts when X
(no dot at the end of the action statement).
I understand it’s because bulloak sees the word ‘when’ in the leaf name and thinks it’s a condition instead of an action.
Ah, not exactly. It's because top-level actions are scaffolded as tests, and thus must be valid identifiers.
Does that make sense to you?
Hmmm… sort of.
But then why
Foo
└── It reverts when X.
fails while
Foo
└── It reverts X.
works?
Ooh, that's because of a parsing error. Great catch! it enters identifier mode in the tokenizer after the when
token. I'll make some time to fix it.
Okay, finally had time to fix this! You can check it [here].(https://github.com/alexfertel/bulloak/commit/488fb6351b49da2c71ce09cd1a06b572988d03c9)
Will publish a new version in a few.
Running
bulloak scaffold Foo.tree
results in an error:bulloak error: invalid identifier: .
.I understand it’s because bulloak sees the word ‘when’ in the leaf name and thinks it’s a condition instead of an action.
While I understand I could write:
I don’t like that because then the action statement becomes a comment which is not checked with
bulloak check
if removed.Besides, there are legitimate usecases for the word ‘when’ used to describe the action.
Expected behavior: The word ‘when’ has a special meaning only at the beginning of a leaf name.