-
-
Notifications
You must be signed in to change notification settings - Fork 609
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
Fix and test graph parsing #1447
Conversation
✅ Deploy Preview for conkyweb canceled.
|
Nice work, @bi4k8. This lets me omit the width / height from my I do, however, find that variables nested within those declarations fail to parse. Is this intended? Here are example declarations that fail:
The new behaviour is actually better than 1.17.0-1 in that it draws the graph in a default red, rather than throwing an |
this simplifies the implementation of graph parsing and makes it less ambiguous to parse graphs in contexts where commands are not expected
Unfortunately, you can't arbitrarily substitute Conky "variables" the way you might expect from the name. A workaround for what you're doing is to use templates, which are substituted the way you would expect:
|
* specials: comment all parser cases * specials: scan_graph: early-return if args is null * specials: fix logic in scan_graph * tests: add scan_graph parsing test * specials: separate command parsing from graph parsing this simplifies the implementation of graph parsing and makes it less ambiguous to parse graphs in contexts where commands are not expected * specials: tweak comments in scan_graph * tests: update for scan_command separation --------- Co-authored-by: bi4k8 <bi4k8@github>
Fixes #1428.
Checklist
doc/
has been updatedDescription
First I did a couple cleanups (adding comments and moving an enveloping
if
into an early-return) toscan_graph
to make it easier to read and edit. Then I reorganized the cases to correct the misparsing that was introduced in 5e98c49. But I still wasn't happy with how the code looked, so I wanted to simplify it further. I added a test case that exercises the parser on its own, then separated out parsing of a quoted command prefix fromscan_graph
, as it's a separate concern and not all callers even accept a command prefix (and some consider one optional, such as the net graphs). This cuts the number of cases thatscan_graph
has to handle in half.I tested against a few conkyrc files from #1428 to verify that this PR corrects the regression, but more testing would be appreciated as it seems this impacted quite a few people (sorry!). This PR shouldn't change any behavior other than fixing the bug, but because it does touch all users of graphs, it would be good to give it some fairly thorough testing.