-
Notifications
You must be signed in to change notification settings - Fork 677
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
Removing a key using CLI now actually saves changes to nuget.config #4080
Conversation
<config> | ||
<add key=""" + keyName + @""" value=""Highest"" /> | ||
</config> | ||
</configuration>"; |
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.
var config = $@"
<configuration>
<config>
<add key=""{keyName}"" value=""Highest"" />
</config>
</configuration>";
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.
I actually agree that this is easier to read, but in recent PR reviews, I've learned it's worse performance. Since this is a test, perf isn't really critical here, and it's probably negligible anyway, but I don't see enough value to rerun CI since it's already green.
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.
Unless the compiler has improvements I don't know about, interpolated strings (strings starting with $
) are syntactic sugar for string.Format
, which has much slower runtime performance than string.Concat
(which operator +(string a, string b)
is syntactic sugar for).
This is a test, so it's not a perf-critical hot-path. But, unless you find concatenated strings much less readable than interpolated strings, I think it's fine as-is.
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.
Minor suggestion.
<config> | ||
<add key=""" + keyName + @""" value=""Highest"" /> | ||
</config> | ||
</configuration>"; |
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.
Unless the compiler has improvements I don't know about, interpolated strings (strings starting with $
) are syntactic sugar for string.Format
, which has much slower runtime performance than string.Concat
(which operator +(string a, string b)
is syntactic sugar for).
This is a test, so it's not a perf-critical hot-path. But, unless you find concatenated strings much less readable than interpolated strings, I think it's fine as-is.
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.
LGTM. I'm curious how it works with nested nuget.config files.
Bug
Fixes: NuGet/Home#8223
Regression? Last working version: No (not in this major version at least)
Description
It seems that removing a key has never actually updated the nuget.config file.
PR Checklist
PR has a meaningful title
PR has a linked issue.
Described changes
Tests
Documentation