-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Remove use of var
to follow project code style
#11276
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
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.
+1
Plan to speed review, just voting for the change right now.
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.
@RussKie has some bigger PRs that may be affected and should comment before merge
var firstId = Module.RevParse(gitStash.Name + "^"); | ||
var firstRev = firstId is null ? null : new GitRevision(firstId); | ||
ObjectId firstId = Module.RevParse(gitStash.Name + "^"); | ||
GitRevision firstRev = firstId is null ? null : new GitRevision(firstId); |
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 expected IDE0090 for the assignment and null annotation is obviously not handled
GitRevision firstRev = firstId is null ? null : new GitRevision(firstId); | |
GitRevision? firstRev = firstId is null ? null : new(firstId); |
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.
NRTA not enabled in the UI project, which is tech debt.
var patchesList = new SortablePatchesList(); | ||
string text = System.IO.File.ReadAllText(PatchFileNameEdit.Text, GitModule.LosslessEncoding); | ||
List<Patch> patches = PatchProcessor.CreatePatchesFromString(text, new Lazy<Encoding>(() => Module.FilesEncoding)).ToList(); | ||
SortablePatchesList patchesList = new SortablePatchesList(); |
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.
SortablePatchesList patchesList = new SortablePatchesList(); | |
SortablePatchesList patchesList = new(); |
@@ -67,7 +67,9 @@ | |||
|
|||
<!-- Settings --> | |||
<None Update="Properties\Settings.settings" Generator="SettingsSingleFileGenerator" LastGenOutput="Settings.Designer.cs" /> | |||
<Compile Update="Properties\Settings.Designer.cs" AutoGen="True" DependentUpon="Settings.settings" /> | |||
<Compile Update="Properties\Settings.Designer.cs" AutoGen="True" DependentUpon="Settings.settings"> | |||
<DesignTimeSharedInput>True</DesignTimeSharedInput> |
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.
?
@@ -49,7 +49,7 @@ public static class GitUIExtensions | |||
return; | |||
} | |||
|
|||
var firstId = item.FirstRevision?.ObjectId ?? item.SecondRevision.FirstParentId; | |||
ObjectId firstId = item.FirstRevision?.ObjectId ?? item.SecondRevision.FirstParentId; |
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.
ObjectId firstId = item.FirstRevision?.ObjectId ?? item.SecondRevision.FirstParentId; | |
ObjectId? firstId = item.FirstRevision?.ObjectId ?? item.SecondRevision.FirstParentId; |
|
||
if (file.IsSubmodule && task is not null) | ||
{ | ||
// Patch already evaluated | ||
var status = await task; | ||
GitSubmoduleStatus status = await task; |
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.
GitSubmoduleStatus status = await task; | |
GitSubmoduleStatus? status = await task; |
if (currentCredentials.UserName == userName && currentCredentials.Password == password) | ||
{ | ||
return; | ||
} | ||
} | ||
|
||
var newCredentials = string.IsNullOrWhiteSpace(userName) | ||
NetworkCredential newCredentials = string.IsNullOrWhiteSpace(userName) |
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.
NetworkCredential newCredentials = string.IsNullOrWhiteSpace(userName) | |
NetworkCredential? newCredentials = string.IsNullOrWhiteSpace(userName) |
The nullable annotations should be done anyway, so taking this to avoid any conflicts. Thank you |
FYI: Call me naive but I just noticed that VS automatic conversion of all the Solution has done only a very small subset (around 1/4) 😭 😭 😭 |
🤣
|
There's a diagnostics that should be dialled up in the .editorconfig file.
|
Note: done automatically by VS (with 2 or 3 small adaptations -- code indentation and tuples not 100% well handled--)
Test methodology
Test environment(s)
Merge strategy
I agree that the maintainer squash merge this PR (if the commit message is clear).
✒️ I contribute this code under The Developer Certificate of Origin.