-
Notifications
You must be signed in to change notification settings - Fork 735
Remove CA1305 suppressions (part3 final) #4754
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
Conversation
dominoFire
left a 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.
Some comments to start.
|
@dominoFire With your comment, I looked again at the changes and updated some of the suppressions to |
| _solutionEvents.ProjectRenamed += OnEnvDTEProjectRenamed; | ||
|
|
||
| var vSStd97CmdIDGUID = VSConstants.GUID_VSStandardCommandSet97.ToString("B", CultureInfo.CurrentCulture); | ||
| var vSStd97CmdIDGUID = VSConstants.GUID_VSStandardCommandSet97.ToString("B", CultureInfo.InvariantCulture); |
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 left a comment in a previous PR after it had been merged (mb), I think we should ignore the warnings raised for Guid ToString as this has the potential to break eeventually.
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 thought you mean to change it to InvariantCulture but I can add the suppressions for this. Or I can pass null to the method call. https://docs.microsoft.com/en-us/dotnet/api/system.guid.tostring?view=net-6.0#system-guid-tostring(system-string-system-iformatprovider)
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.
null's fine if we mean to avoid the warning
dominoFire
left a 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.
More partial review, 60% review left.
src/NuGet.Core/NuGet.PackageManagement/Telemetry/ActionEventBase.cs
Outdated
Show resolved
Hide resolved
nkolev92
left a 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.
That's a lot of changes :D
Good job getting all tedious work done.
14aaa04 to
cefb350
Compare
dominoFire
left a 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.
Good job! Some comments on cases where it could be better to use InvariantCulture
src/NuGet.Clients/NuGet.PackageManagement.VisualStudio/IDE/VSSolutionManager.cs
Outdated
Show resolved
Hide resolved
| for (int i = 0; i < 10000; i++) | ||
| { | ||
| sb.AppendLine(i.ToString()); | ||
| sb.AppendLine(i.ToString(CultureInfo.CurrentCulture)); |
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.
You can append the integer directly
| sb.AppendLine(i.ToString(CultureInfo.CurrentCulture)); | |
| sb.AppendLine(i); |
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.
Unfortunately, AppendLine only accepts a string
src/NuGet.Core/NuGet.Protocol/Plugins/Logging/PluginLogMessage.cs
Outdated
Show resolved
Hide resolved
| if (flags == SignatureVerificationStatusFlags.NoErrors) | ||
| { | ||
| issues.Add(SignatureLog.InformationLog(string.Format(CultureInfo.CurrentCulture, Strings.TimestampValue, GeneralizedTime.LocalDateTime.ToString()) + Environment.NewLine)); | ||
| issues.Add(SignatureLog.InformationLog(string.Format(CultureInfo.CurrentCulture, Strings.TimestampValue, GeneralizedTime.LocalDateTime.ToString(CultureInfo.CurrentCulture)) + Environment.NewLine)); |
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.
There seems no behavior change. I think this is expected?
string.Format(CultureInfo.CurrentCulture, s1, dateTime.ToString()) is equal to
string.Format(CultureInfo.CurrentCulture, s1, dateTime.ToString(CultureInfo.CurrentCulture)), right?
|
This PR has been automatically marked as stale because it has no activity for 7 days. It will be closed if no further activity occurs within another 7 days of this comment. If it is closed, you may reopen it anytime when you're ready again, as long as you don't delete the branch. |
ea7320d to
39e83fc
Compare
Bug
Fixes: https://github.com/NuGet/Client.Engineering/issues/1170
Regression? Last working version:
Description
Removing suppressions for CA1305, I'm also changing the rule action to be
Warningbut this is causing some error on ReadOnly files, I added file suppressions for these ones since I cannot modify them.PR Checklist
PR has a meaningful title
PR has a linked issue.
Described changes
Tests
Documentation