-
Notifications
You must be signed in to change notification settings - Fork 92
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
Update code to use 'var' where type is explicit. #2817
Changes from all commits
f3c5879
95e9e92
4ddef97
4bf4949
930d6e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -297,6 +297,7 @@ csharp_style_prefer_local_over_anonymous_function = true:suggestion | |
dotnet_diagnostic.SA1602.severity = suggestion | ||
dotnet_diagnostic.SA1307.severity = silent | ||
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion | ||
csharp_style_prefer_primary_constructors = true:suggestion | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
[*Tests.cs] | ||
|
||
|
@@ -323,4 +324,5 @@ dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion | |
dotnet_style_prefer_compound_assignment = true:suggestion | ||
dotnet_style_prefer_simplified_interpolation = true:suggestion | ||
dotnet_style_namespace_match_folder = true:suggestion | ||
dotnet_code_quality_unused_parameters = all:error | ||
dotnet_code_quality_unused_parameters = all:error | ||
dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -50,7 +50,7 @@ public override void Convert(Stream input, IResultLogWriter output, OptionallyEm | |||
|
||||
LogicalLocations.Clear(); | ||||
|
||||
XmlReaderSettings settings = new XmlReaderSettings | ||||
var settings = new XmlReaderSettings | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see Line 80 in 29f145e
While this PR is a great cleanup, unless it's enforced in the PR check (https://github.com/microsoft/sarif-sdk/pull/2817/checks), the inconsistent style is going to creep back in. This is likely due to Consider fixing that in this PR, too. |
||||
{ | ||||
IgnoreWhitespace = true, | ||||
IgnoreComments = true, | ||||
|
@@ -61,7 +61,7 @@ public override void Convert(Stream input, IResultLogWriter output, OptionallyEm | |||
}; | ||||
|
||||
IList<Result> results; | ||||
using (XmlReader xmlReader = XmlReader.Create(input, settings)) | ||||
using (var xmlReader = XmlReader.Create(input, settings)) | ||||
{ | ||||
results = ProcessAndroidStudioLog(xmlReader); | ||||
} | ||||
|
@@ -244,7 +244,7 @@ private static void SetSarifResultPropertiesForProblem(Result result, AndroidStu | |||
|
||||
private static string GenerateFullMessage(string description, ImmutableArray<string> hints) | ||||
{ | ||||
StringBuilder sb = new StringBuilder(); | ||||
var sb = new StringBuilder(); | ||||
sb.Append(description); | ||||
foreach (string hint in hints) | ||||
{ | ||||
|
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.
Internet query informed me that
EnforceCodeStyleInBuild
as expressed in csproj files only works within the IDE. For CLI builds you need to explicitly set this property (which appears to be a bit of a hammer, i.e., it will be applied everywhere. Fortunately that's what we want).