You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Example Test Suite: command containing '#' is not workingΒ #6621
changing to case s"$before #$after" => (before.trim, Some(after.trim)) gives a somewhat easy way to workaround this, otherwise I can implement some escaping + single quotes, though it's gonna get complex
I think the example test suite tries to mimic a regular shell and # is the typical comment symbol in shells, so keeping the # is IMHO the most intuitive thing. We either want to enforce a leading space before the # or implement some masking via \#. We should also look how shells like bash or zsh handle it, which is probably a full parsing routine supporting quoting and any kind of nested masking. We have that at hand (via fastparse) but it's probably overkill.
I think the example test suite tries to mimic a regular shell and # is the typical comment symbol in shells, so keeping the # is IMHO the most intuitive thing. We either want to enforce a leading space before the # or implement some masking via \#. We should also look how shells like bash or zsh handle it, which is probably a full parsing routine supporting quoting and any kind of nested masking. We have that at hand (via fastparse) but it's probably overkill.
it it's good enough for you the space seems to not be breaking anything we have in the example tests so far. At least on my local, my bash seems to interpret the '#' as a string continuation (without a space)
Activity
vaslabs commentedon Jan 19, 2026
Probably matches this before#after in
ExampleTestervaslabs commentedon Jan 19, 2026
maybe we do it with a space? it's not a standard as far as I can tell/find, but
vaslabs commentedon Jan 19, 2026
changing to
case s"$before #$after" => (before.trim, Some(after.trim))gives a somewhat easy way to workaround this, otherwise I can implement some escaping + single quotes, though it's gonna get complexvaslabs commentedon Jan 19, 2026
let's see how many things break https://github.com/vaslabs-ltd/mill/tree/test-hash-example-tester
vaslabs commentedon Jan 19, 2026
looks ok with the space (but my branch is based on this branch so I can do it after that one is merged)
lefou commentedon Jan 19, 2026
I think the example test suite tries to mimic a regular shell and
#is the typical comment symbol in shells, so keeping the#is IMHO the most intuitive thing. We either want to enforce a leading space before the#or implement some masking via\#. We should also look how shells like bash or zsh handle it, which is probably a full parsing routine supporting quoting and any kind of nested masking. We have that at hand (via fastparse) but it's probably overkill.vaslabs commentedon Jan 19, 2026
it it's good enough for you the space seems to not be breaking anything we have in the example tests so far. At least on my local, my bash seems to interpret the '#' as a string continuation (without a space)
lefou commentedon Jan 19, 2026
Let's add the space before
#requirement to make it a comment, as you suggested.vaslabs commentedon Feb 15, 2026
@souvlakias a quick one for tomorrow + to add the
#methodtest , my branch here is out of sync so can create a fresh onehttps://github.com/vaslabs-ltd/mill/tree/test-hash-example-tester
ExampleTester: Support commands with `#` (com-lihaoyi#6834)