-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* #109 Updated project settings, added NRT changes, all tests pass * Updated example app in .NET Core 3.1, now needs to update to .NET 6 * Upgraded/changed the example project to .NET 6 * Updated NuGet package references * Updated .editorconfig settings and Authors value Co-authored-by: Jason Bock <jasonbock1@rocketmortgage.com>
- Loading branch information
Showing
26 changed files
with
364 additions
and
346 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
|
||
[*.cs] | ||
# Styling | ||
indent_style = space | ||
indent_size = 4 | ||
csharp_indent_case_contents = true | ||
csharp_indent_switch_labels = true | ||
csharp_new_line_before_catch = true | ||
csharp_new_line_before_else = true | ||
csharp_new_line_before_finally = true | ||
csharp_new_line_before_members_in_anonymous_types = false | ||
csharp_new_line_before_members_in_object_initializers = false | ||
csharp_new_line_before_open_brace = methods, control_blocks, types, properties, lambdas, accessors, object_collection_array_initializers | ||
csharp_new_line_between_query_expression_clauses = true | ||
csharp_prefer_braces = false:suggestion | ||
csharp_prefer_simple_default_expression = true:suggestion | ||
csharp_preferred_modifier_order = public,private,internal,protected,static,readonly,async,override,sealed:suggestion | ||
csharp_preserve_single_line_blocks = true | ||
csharp_preserve_single_line_statements = true | ||
csharp_space_after_cast = false | ||
csharp_space_after_colon_in_inheritance_clause = true | ||
csharp_space_after_keywords_in_control_flow_statements = true | ||
csharp_space_before_colon_in_inheritance_clause = true | ||
csharp_space_between_method_call_empty_parameter_list_parentheses = false | ||
csharp_space_between_method_call_name_and_opening_parenthesis = false | ||
csharp_space_between_method_call_parameter_list_parentheses = false | ||
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false | ||
csharp_space_between_method_declaration_parameter_list_parentheses = false | ||
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion | ||
csharp_style_expression_bodied_accessors = true:suggestion | ||
csharp_style_expression_bodied_constructors = false:suggestion | ||
csharp_style_expression_bodied_methods = false:suggestion | ||
csharp_style_expression_bodied_properties = true:suggestion | ||
csharp_style_inlined_variable_declaration = true:suggestion | ||
csharp_style_var_elsewhere = true:suggestion | ||
csharp_style_var_for_built_in_types = true:suggestion | ||
csharp_style_var_when_type_is_apparent = true:suggestion | ||
dotnet_sort_system_directives_first = false | ||
dotnet_style_explicit_tuple_names = true:suggestion | ||
dotnet_style_object_initializer = true:suggestion | ||
csharp_style_pattern_local_over_anonymous_function = false:suggestion | ||
dotnet_style_predefined_type_for_member_access = true:suggestion | ||
dotnet_style_prefer_inferred_anonymous_type_member_names = false:suggestion | ||
dotnet_style_prefer_inferred_tuple_names = true:suggestion | ||
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion | ||
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion | ||
dotnet_style_qualification_for_field = false:suggestion | ||
dotnet_style_qualification_for_method = false:suggestion | ||
dotnet_style_qualification_for_property = false:suggestion | ||
|
||
|
||
# Analyzer Configuration | ||
# These are rules we want to either ignore or have set as suggestion or info | ||
|
||
# CA1014: Mark assemblies with CLSCompliant | ||
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1014 | ||
dotnet_diagnostic.CA1014.severity = none | ||
|
||
# CA1725: Parameter names should match base declaration | ||
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1725 | ||
dotnet_diagnostic.CA1725.severity = suggestion | ||
|
||
# CA2227: Collection properties should be read only | ||
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2227 | ||
dotnet_diagnostic.CA2227.severity = suggestion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<Project> | ||
<PropertyGroup Condition=" '$(TargetFramework)' == 'net48' or '$(TargetFramework)' == 'netcoreapp3.1'"> | ||
<EnableNETAnalyzers>true</EnableNETAnalyzers> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<AnalysisMode>AllEnabledByDefault</AnalysisMode> | ||
<Authors>Rocket Mortgage</Authors> | ||
<LangVersion>latest</LangVersion> | ||
<Nullable>enable</Nullable> | ||
<TargetFrameworks>net6.0;netcoreapp3.1;net48</TargetFrameworks> | ||
<NoWarn>NU1603,NU1701</NoWarn> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
</PropertyGroup> | ||
<ItemGroup Condition=" '$(TargetFramework)' == 'net48' or '$(TargetFramework)' == 'netcoreapp3.1'"> | ||
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
<PropertyGroup> | ||
<TargetFrameworks>net6.0</TargetFrameworks> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\RockLib.DistributedTracing.AspNetCore\RockLib.DistributedTracing.AspNetCore.csproj" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Microsoft.AspNetCore.Builder; | ||
using Middleware.NET60; | ||
using RockLib.DistributedTracing.AspNetCore; | ||
using System; | ||
using System.Linq; | ||
using System.Security.Cryptography; | ||
|
||
#pragma warning disable CA1812 | ||
|
||
var builder = WebApplication.CreateBuilder(args); | ||
|
||
// Use this to change the name of the correlation id header | ||
//builder.Services.Configure<CorrelationIdMiddlewareOptions>(options => options.HeaderName = "Custom-Id-Header"); | ||
|
||
var app = builder.Build(); | ||
|
||
app.UseCorrelationIdMiddleware(); | ||
|
||
app.MapGet("/", () => | ||
{ | ||
return Enumerable.Range(1, 5).Select(index => new WeatherForecast | ||
{ | ||
Date = DateTime.Now.AddDays(index), | ||
TemperatureC = RandomNumberGenerator.GetInt32(-20, 55), | ||
Summary = WeatherForecast.Summaries[RandomNumberGenerator.GetInt32(WeatherForecast.Summaries.Length)] | ||
}).ToArray(); | ||
}); | ||
|
||
app.Run(); |
18 changes: 8 additions & 10 deletions
18
...coreapp3.1/Properties/launchSettings.json → ...ware.NET60/Properties/launchSettings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
|
||
namespace Middleware.NET60; | ||
|
||
public sealed class WeatherForecast | ||
{ | ||
public static readonly string[] Summaries = new[] | ||
{ | ||
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" | ||
}; | ||
|
||
public DateTime Date { get; init; } | ||
|
||
public int TemperatureC { get; init; } | ||
|
||
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); | ||
|
||
public string? Summary { get; init; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 0 additions & 38 deletions
38
Examples/Middleware.netcoreapp3.1/Controllers/WeatherForecastController.cs
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
Examples/Middleware.netcoreapp3.1/Middleware.netcoreapp3.1.csproj
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
Examples/Middleware.netcoreapp3.1/appsettings.Development.json
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
RockLib.DistributedTracing.AspNetCore.Tests/AssemblySettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
using Xunit; | ||
|
||
[assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.