rattler-build icon indicating copy to clipboard operation
rattler-build copied to clipboard

Disallow `-` in context variable names

Open wolfv opened this issue 1 year ago • 1 comments

Since - is also the minus operator which will probably not work in jinja, we should forbid it in the left-hand side in the context, e.g.

context:
  foo-bar: baz

should trigger a parsing error.

wolfv avatar Jul 30 '24 07:07 wolfv

Hey, I'd love to tackle this! Is this the correct place that I should be changing - https://github.com/prefix-dev/rattler-build/blob/main/src/recipe/parser.rs#L184-L193

Would adding something along the lines of "if k.contains("-") ... ERR" be correct?

Sorry for ping: @wolfv?

Heidar-An avatar Aug 03 '24 16:08 Heidar-An