Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

White Space in Sound config #322

Open
c-git opened this issue Feb 1, 2025 · 2 comments
Open

White Space in Sound config #322

c-git opened this issue Feb 1, 2025 · 2 comments

Comments

@c-git
Copy link
Contributor

c-git commented Feb 1, 2025

Hi,

Haven't had a chance to look at the code yet to understand why but the parsing of the sound configuration is sensitive to white space. I'm not sure if that is the intended behaviour but it was a bit surprising. In the example below note the space after the comma between the working and non-working versions.

This one fails to parse

sound.enabled = true

[jobs.check]
command = ["cargo", "check"]
on_success = "play-sound(name=car-horn, volume=5)"

with error

Error: Failed to parse configuration file at "/home/one/t/bacon.toml"

Caused by:
    TOML parse error at line 6, column 14
      |
    6 | on_success = "play-sound(name=car-horn, volume=5)"
      |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    Action not understood: "play-sound(name=car-horn, volume=5)" (did you mean "job:play-sound(name=car-horn, volume=5)"?)

but this on is fine

sound.enabled = true

[jobs.check]
command = ["cargo", "check"]
on_success = "play-sound(name=car-horn,volume=5)"
@Canop
Copy link
Owner

Canop commented Feb 1, 2025

No objection regarding supporting white spaces here. Do you want to make a PR ?

@c-git
Copy link
Contributor Author

c-git commented Feb 1, 2025

I wouldn't mind. I most likely can't do it this weekend but I wouldn't mind doing it once I have a bit of time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants