Skip to content

Commit

Permalink
Fixing docs and other warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jbogard committed Feb 26, 2020
1 parent c3fe06b commit 893b8d7
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 19 deletions.
72 changes: 62 additions & 10 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,19 +1,71 @@
root=true
; EditorConfig helps developers define and maintain consistent
; coding styles between different editors and IDEs.

; For more visit http://editorconfig.org.
root = true

; Choose between lf or rf on "end_of_line" property
[*]
indent_style = space
charset = utf-8
trim_trailing_whitespace = true
indent_size = 4
[*.proto]
indent_style=tab
indent_size=tab
tab_width=4

[*.{asax,ascx,aspx,cs,cshtml,css,htm,html,js,jsx,master,razor,skin,ts,tsx,vb,xaml,xamlx,xoml}]
indent_style=space
indent_size=4
tab_width=4

[*.{appxmanifest,build,config,csproj,dbml,discomap,dtd,json,jsproj,lsproj,njsproj,nuspec,proj,props,resjson,resw,resx,StyleCop,targets,tasks,vbproj,xml,xsd}]
indent_style=space
indent_size=2
tab_width=2

[*]

[*.cs]
indent_size = 4
# Standard properties
end_of_line=native
insert_final_newline=false

[*.json]
indent_size = 2
# Microsoft .NET properties
csharp_indent_braces=false
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_object_initializers=false
csharp_new_line_before_open_brace=all
csharp_new_line_between_query_expression_clauses=true
csharp_preferred_modifier_order=public, private, protected, internal, new, abstract, virtual, sealed, override, static, readonly, extern, unsafe, volatile, async:suggestion
csharp_preserve_single_line_blocks=true
csharp_space_after_cast=true
csharp_space_after_colon_in_inheritance_clause=true
csharp_space_after_comma=true
csharp_space_after_dot=false
csharp_space_after_keywords_in_control_flow_statements=true
csharp_space_after_semicolon_in_for_statement=true
csharp_space_around_binary_operators=before_and_after
csharp_space_before_colon_in_inheritance_clause=true
csharp_space_before_comma=false
csharp_space_before_dot=false
csharp_space_before_open_square_brackets=false
csharp_space_before_semicolon_in_for_statement=false
csharp_space_between_empty_square_brackets=false
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_name_and_open_parenthesis=false
csharp_space_between_method_declaration_parameter_list_parentheses=false
csharp_space_between_parentheses=false
csharp_space_between_square_brackets=false
csharp_style_var_elsewhere=true:hint
csharp_style_var_for_built_in_types=true:hint
csharp_style_var_when_type_is_apparent=true:hint
csharp_using_directive_placement=outside_namespace:silent
dotnet_style_predefined_type_for_locals_parameters_members=true:hint
dotnet_style_predefined_type_for_member_access=true:hint
dotnet_style_qualification_for_event=false:hint
dotnet_style_qualification_for_field=false:hint
dotnet_style_qualification_for_method=false:hint
dotnet_style_qualification_for_property=false:hint
dotnet_style_require_accessibility_modifiers=for_non_interface_members:hint
5 changes: 4 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<PropertyGroup>
<Authors>Jimmy Bogard</Authors>
<LangVersion>latest</LangVersion>
<VersionPrefix>8.0.0</VersionPrefix>
<VersionPrefix>8.0.1</VersionPrefix>
<NoWarn>$(NoWarn);1701;1702;1591</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
</PropertyGroup>
</Project>
1 change: 1 addition & 0 deletions MediatR.sln
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MediatR.Examples.AspNetCore
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1E133765-6B4E-46C2-8C6C-7238E8EABA79}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
appveyor.yml = appveyor.yml
Build.ps1 = Build.ps1
Directory.Build.props = Directory.Build.props
Expand Down
11 changes: 6 additions & 5 deletions src/MediatR/MediatR.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,25 @@
<AssemblyName>MediatR</AssemblyName>
<PackageId>MediatR</PackageId>
<PackageTags>mediator;request;response;queries;commands;notifications</PackageTags>
<PackageIconUrl>https://raw.githubusercontent.com/jbogard/MediatR/master/assets/logo/gradient_128x128.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/jbogard/MediatR</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/jbogard/MediatR/blob/master/LICENSE</PackageLicenseUrl>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>git://github.com/jbogard/mediatr</RepositoryUrl>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\MediatR.snk</AssemblyOriginatorKeyFile>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageIcon>gradient_128x128.png</PackageIcon>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-preview.2" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-62925-02">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<None Include="..\..\assets\logo\gradient_128x128.png" Pack="true" PackagePath=""/>
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions src/MediatR/Pipeline/IRequestExceptionAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ async Task IRequestExceptionAction<TRequest, Exception>.Execute(TRequest request
/// Wrapper class that synchronously performs an action on a request for specific exception
/// </summary>
/// <typeparam name="TRequest">Request type</typeparam>
/// <typeparam name="TException">Exception type</typeparam>
public abstract class RequestExceptionAction<TRequest, TException> : IRequestExceptionAction<TRequest, TException>
where TException : Exception
{
Expand Down
2 changes: 1 addition & 1 deletion test/MediatR.Tests/ExceptionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public class PingException : IRequest

public class PingExceptionHandler : IRequestHandler<PingException>
{
public async Task<Unit> Handle(PingException request, CancellationToken cancellationToken)
public Task<Unit> Handle(PingException request, CancellationToken cancellationToken)
{
throw new NotImplementedException();
}
Expand Down
8 changes: 6 additions & 2 deletions test/MediatR.Tests/UnitTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Linq;
using System.Collections.Generic;
using System.Threading.Tasks;
using Xunit;
Expand Down Expand Up @@ -61,6 +62,9 @@ public static object[][] ValueData()
};
}

public static object[][] CompareToValueData()
=> ValueData().Select(objects => new[] { objects[0] }).ToArray();

[Theory]
[MemberData(nameof(ValueData))]
public void Should_be_equal(object value, bool isEqual)
Expand All @@ -74,8 +78,8 @@ public void Should_be_equal(object value, bool isEqual)
}

[Theory]
[MemberData(nameof(ValueData))]
public void Should_compareto_value_as_zero(object value, bool _)
[MemberData(nameof(CompareToValueData))]
public void Should_compareto_value_as_zero(object value)
{
var unit1 = new Unit();

Expand Down

0 comments on commit 893b8d7

Please sign in to comment.