-
Notifications
You must be signed in to change notification settings - Fork 72
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
Subject (and possibly other rules) with quotes #66
Comments
You don't really need to put quotes in your filters, they are automatically added.
Results in:
Additional possibilities:
I hope it helps. |
Yea I understand that now. My point is not that it should be supported. What I am saying is if there is a quote inside current behavior is confusing. Since it doesn't make sense to put a quote inside it's better to prohibit it/print a warning.
It doesn't :) I actually quite liked it. However gmailctl should check if there are quotes inside and warn users that this will produce syntactically invalid result instead of silently doing so, or better not do it at all. |
You're right, I can print a warning if that happens. Contributions also welcome! |
Sure! I think the best place to put the fix would be here: gmailctl/internal/engine/filter/convert.go Lines 175 to 191 in 582979d
We can just return an error if a leaf is already quoted and not marked as |
Or perhaps even better, to make this function fail if the thing to quote is already quoted: gmailctl/internal/engine/filter/convert.go Lines 236 to 238 in 582979d
|
I just ran into this behavior change when trying to update my filters. Are you sure it's correct? I had a lot of |
Ow, sorry about that. Perhaps though I'm fine with reverting for now. TBH I wasn't expecting anyone to use quotes inside Could you also explain why |
I think that's why, but I'm honestly not sure: it's just something I observed when setting up my filters. Auto-quoting gmailctl/internal/engine/filter/convert.go Line 258 in 6f10365
As a meta-note: I wonder if there would be a better way to roll out new validations such that issues like this could be flagged earlier. The problem is that the validations only run when someone tries to apply their config, which usually only happens when they're editing. It would be nice if the config were reparsed as part of updating gmailctl. I don't think |
Reverting sounds good for now. I'll take a look at a proper fix later on. |
Quotes inside subject produce unexpected result, they basically remove quoting. Escaping is not really supported in GMail so it would be nice to print an error message if this happens to not confuse users.
The text was updated successfully, but these errors were encountered: