-
Notifications
You must be signed in to change notification settings - Fork 3
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
Replace manual parsing of head comments #2
Conversation
@SgtCoDFish |
It seems like the "weirdness" is that there's a difference between the following: # Comment
targets:
target1:
- ... On the above, the comment is on the "document" and this PR will preserve it. # Comment
targets:
target1:
- ... On this one, the coment is on the |
This leaves more to the YAML parser so we have less chance of accidentally introducing a bug or security issue in our own logic. Also adds preservation of footer comments as a bonus! Signed-off-by: Ashley Davis <[email protected]>
ce51deb
to
5c7ee8d
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The latest commit passes the tests by adding a newline to the test cases so that the comments are now doc comments. I dunno about this... it makes sense to only preserve doc comments to me, and I can see why the yaml parser would treat the other comments differently. I'm not militant about it though |
I think it'd be better to use a YAML parser for this but I don't think it's worth the effort coming up with a better solution here. Closing. |
Thanks for testing and letting me know about the io.EOF error btw! |
This leaves more to the YAML parser so we have less chance of accidentally introducing a bug or security issue in our own logic.
Also adds preservation of footer comments as a bonus!
In addition, this fixes
klone init
andklone add
which are currently broken on main when run in a directory with noklone.yaml
. That bug was caused by the comment preservation logic!