-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Added logic to preserve carriage returns when updating the manifest file #14983
base: master
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
e4154fe
to
791460f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this does what we want. However, I am not sure if this should be in toml_edit or in Cargo. Found one relevant comment from an issue: toml-rs/toml#752 (comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#14863 isn't marked as S-accepted
. I would generally recommend discussing there, and leave this for implementation only dicussion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't marked as S-accepted. I would generally recommend discussing there, and leave this for implementation only dicussion.
ah my bad 😅 I was looking through C-bug
issues for small bugs to work on to learn/get some experience with the Cargo codebase. I'll be sure to stick to S-accepted or at least discuss further on the issue before starting/opening a PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be auto-converted, if core.autocrlf = true
is set in git configuration on Linux. So the test always passes even without this patch. I haven't tested it locally though. Maybe we should have a .gitattributes
file and set the file eol=crlf
?
Slightly related, in contributing doc we recommend splitting new tests into its own commit, and it still passes CI. Then followed by a fix and a test update. The test change in the second commit tell that that the bug is actually there, and the patch really fixes it.
What does this PR try to resolve?
This is an attempt to preserve
/r/n
line endings inCargo.toml
duringcargo add
/remove
by checking if it already had at least one/r/n
.See #14863
Additional information
For testing, it appears that snapbox will normalize line ending so the tests will directly compare the file contents.