Add space to separate comments from tokens #216
No reviewers
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#216
Loading…
Reference in New Issue
No description provided.
Delete Branch ":comments-white-space"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
https://yaml.org/spec/1.2/spec.html#id2780069
Seems like this is all that needs to be done, but not sure.
Thanks for catching this! Would you mind updating the tests as well to reflect this change? The tests in question are in
tests/integration/config/test_generate.py
.Is there special handling that needs to be done to make sure commented blank lines don't turn into
#
?Edit: There's a space after # that isn't being rendered.
Not sure. I don't see any cases in the generated config file (with your code changes in place) where blank lines get commented out. Is there somewhere you're seeing a blank line get commented?
Here and below I had to do as such.
Ah, gotcha! Okay, if you want to prevent commented-out blank lines from ending up with a space after the
#
, you can change the commenting-out logic a bit. I'll add a note where you can do that above.So, if you want to deal with the blank line situation, you could do something like this:
As there are no commented blank lines in the generated config, I thought the flexmock line in the tests had to be changed. Perhaps both?
It's really up to you. I could see either changing the tests as you already did, or changing the code to handle the blank line special case. Just let me know!
Making this change doesn't effect the outcome of the test, so I guess we're good to go here. 🤷
Looks good. Thanks for adding tests!