Skip to content

Commit

Permalink
Namespace layout and RESHARPER GREEN!
Browse files Browse the repository at this point in the history
  • Loading branch information
nblumhardt committed Jun 1, 2017
1 parent ffee0db commit a74938c
Show file tree
Hide file tree
Showing 37 changed files with 97 additions and 126 deletions.
13 changes: 12 additions & 1 deletion Serilog.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@


<s:Boolean x:Key="/Default/CodeEditing/Intellisense/CodeCompletion/AutoCompleteBasicCompletion/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeEditing/Intellisense/CodeCompletion/IntelliSenseCompletingCharacters/CSharpCompletingCharacters/UpgradedFromVSSettings/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeEditing/Intellisense/CodeCompletion/IntelliSenseCompletingCharacters/IntelliSenseCompletingCharactersSettingCSharp/UpgradedFromVSSettings/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeEditing/Intellisense/LookupWindow/ShowSummary/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeEditing/Localization/CSharpLocalizationOptions/DontAnalyseVerbatimStrings/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeInspection/Highlighting/AnalysisEnabled/@EntryValue">SOLUTION</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArgumentsStyleLiteral/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArgumentsStyleNamedExpression/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=AssignToImplicitGlobalInFunctionScope/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BaseObjectEqualsIsObjectEquals/@EntryIndexedValue">ERROR</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=CheckNamespace/@EntryIndexedValue">DO_NOT_SHOW</s:String>
Expand All @@ -16,6 +19,7 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConditionalTernaryEqualBranch/@EntryIndexedValue">ERROR</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConditionIsAlwaysTrueOrFalse/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConstantNullCoalescingCondition/@EntryIndexedValue">ERROR</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertIfStatementToConditionalTernaryExpression/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=CSharpWarnings_003A_003ACS0109/@EntryIndexedValue">ERROR</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=DoubleNegationOperator/@EntryIndexedValue">ERROR</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EmptyConstructor/@EntryIndexedValue">ERROR</s:String>
Expand All @@ -27,8 +31,9 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ExpressionIsAlwaysNull/@EntryIndexedValue">ERROR</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=FieldCanBeMadeReadOnly_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=FieldCanBeMadeReadOnly_002ELocal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ForCanBeConvertedToForeach/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ForCanBeConvertedToForeach/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=InconsistentNaming/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=JoinNullCheckWithUsage/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=LocalizableElement/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MemberCanBePrivate_002EGlobal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MultipleOrderBy/@EntryIndexedValue">ERROR</s:String>
Expand Down Expand Up @@ -103,6 +108,7 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedMember_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedMember_002ELocal/@EntryIndexedValue">SUGGESTION</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedVariable/@EntryIndexedValue">ERROR</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UseNullPropagation/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UseObjectOrCollectionInitializer/@EntryIndexedValue">ERROR</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ValueParameterNotUsed/@EntryIndexedValue">ERROR</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=VBPossibleMistakenCallToGetType_002E1/@EntryIndexedValue">ERROR</s:String>
Expand All @@ -111,6 +117,8 @@
<s:String x:Key="/Default/CodeStyle/CodeCleanup/Profiles/=Format_0020My_0020Code_0020Using_0020_0022Particular_0022_0020conventions/@EntryIndexedValue">&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;Profile name="Format My Code Using &amp;quot;Particular&amp;quot; conventions"&gt;&lt;CSMakeFieldReadonly&gt;True&lt;/CSMakeFieldReadonly&gt;&lt;CSUseVar&gt;&lt;BehavourStyle&gt;CAN_CHANGE_TO_IMPLICIT&lt;/BehavourStyle&gt;&lt;LocalVariableStyle&gt;ALWAYS_IMPLICIT&lt;/LocalVariableStyle&gt;&lt;ForeachVariableStyle&gt;ALWAYS_IMPLICIT&lt;/ForeachVariableStyle&gt;&lt;/CSUseVar&gt;&lt;CSOptimizeUsings&gt;&lt;OptimizeUsings&gt;True&lt;/OptimizeUsings&gt;&lt;EmbraceInRegion&gt;False&lt;/EmbraceInRegion&gt;&lt;RegionName&gt;&lt;/RegionName&gt;&lt;/CSOptimizeUsings&gt;&lt;CSReformatCode&gt;True&lt;/CSReformatCode&gt;&lt;CSReorderTypeMembers&gt;True&lt;/CSReorderTypeMembers&gt;&lt;JsInsertSemicolon&gt;True&lt;/JsInsertSemicolon&gt;&lt;JsReformatCode&gt;True&lt;/JsReformatCode&gt;&lt;CssReformatCode&gt;True&lt;/CssReformatCode&gt;&lt;CSArrangeThisQualifier&gt;True&lt;/CSArrangeThisQualifier&gt;&lt;RemoveCodeRedundancies&gt;True&lt;/RemoveCodeRedundancies&gt;&lt;CSUseAutoProperty&gt;True&lt;/CSUseAutoProperty&gt;&lt;HtmlReformatCode&gt;True&lt;/HtmlReformatCode&gt;&lt;CSShortenReferences&gt;True&lt;/CSShortenReferences&gt;&lt;CSharpFormatDocComments&gt;True&lt;/CSharpFormatDocComments&gt;&lt;CssAlphabetizeProperties&gt;True&lt;/CssAlphabetizeProperties&gt;&lt;/Profile&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/CodeCleanup/RecentlyUsedProfile/@EntryValue">Default: Reformat Code</s:String>
<s:String x:Key="/Default/CodeStyle/CodeCleanup/SilentCleanupProfile/@EntryValue">Format My Code Using "Particular" conventions</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/DEFAULT_INTERNAL_MODIFIER/@EntryValue">Implicit</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/DEFAULT_PRIVATE_MODIFIER/@EntryValue">Implicit</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/EXPLICIT_PRIVATE_MODIFIER/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_FOR_BRACES_STYLE/@EntryValue">DO_NOT_CHANGE</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_FOREACH_BRACES_STYLE/@EntryValue">DO_NOT_CHANGE</s:String>
Expand Down Expand Up @@ -477,10 +485,13 @@ II.2.12 &lt;HandlesEvent /&gt;&#xD;
<s:Boolean x:Key="/Default/CodeStyle/Generate/=Global/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Generate/=Global/Options/=PropertyBody/@EntryIndexedValue">Automatic property</s:String>
<s:Boolean x:Key="/Default/CodeStyle/Generate/=Implementations/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Generate/=Implementations/Options/=Async/@EntryIndexedValue">False</s:String>
<s:String x:Key="/Default/CodeStyle/Generate/=Implementations/Options/=WrapInRegion/@EntryIndexedValue">False</s:String>
<s:String x:Key="/Default/CodeStyle/Generate/=Implementations/Options/=XmlDocumentation/@EntryIndexedValue">False</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AD/@EntryIndexedValue">AD</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DB/@EntryIndexedValue">DB</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DTC/@EntryIndexedValue">DTC</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GT/@EntryIndexedValue">GT</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ID/@EntryIndexedValue">ID</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NSB/@EntryIndexedValue">NSB</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SLA/@EntryIndexedValue">SLA</s:String>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
using Serilog.Events;
using Serilog.Parsing;

namespace Serilog.Parameters
namespace Serilog.Capturing
{
partial class PropertyValueConverter
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
using System.Linq;
using System.Reflection;

namespace Serilog.Parameters
namespace Serilog.Capturing
{
static class GetablePropertyFinder
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
using Serilog.Events;
using Serilog.Parsing;

namespace Serilog.Parameters
namespace Serilog.Capturing
{
class MessageTemplateProcessor : ILogEventPropertyFactory
{
readonly IMessageTemplateParser _parser = new MessageTemplateCache(new MessageTemplateParser());
readonly MessageTemplateCache _parser = new MessageTemplateCache(new MessageTemplateParser());
readonly PropertyBinder _propertyBinder;
readonly PropertyValueConverter _propertyValueConverter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
using Serilog.Events;
using Serilog.Parsing;

namespace Serilog.Parameters
namespace Serilog.Capturing
{
// Performance relevant - on the hot path when creating log events from existing templates.
class PropertyBinder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
using Serilog.Policies;
using System.Runtime.CompilerServices;

namespace Serilog.Parameters
namespace Serilog.Capturing
{
// Values in Serilog are simplified down into a lowest-common-denominator internal
// type system so that there is a better chance of code written with one sink in
Expand Down Expand Up @@ -258,7 +258,7 @@ IEnumerable<LogEventProperty> GetProperties(object value, ILogEventPropertyValue
if (_propagateExceptions)
throw;

propValue = "The property accessor threw an exception: " + ex.InnerException.GetType().Name;
propValue = "The property accessor threw an exception: " + ex.InnerException?.GetType().Name;
}
yield return new LogEventProperty(prop.Name, recursive.CreatePropertyValue(propValue, true));
}
Expand Down
1 change: 0 additions & 1 deletion src/Serilog/Context/LogContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
using Serilog.Events;

#if ASYNCLOCAL
using System.Collections.Generic;
using System.Threading;
#elif REMOTING
using System.Runtime.Remoting;
Expand Down
2 changes: 1 addition & 1 deletion src/Serilog/Core/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

using System;
using System.Collections.Generic;
using Serilog.Capturing;
using Serilog.Core.Enrichers;
using Serilog.Debugging;
using Serilog.Events;
using Serilog.Parameters;

#pragma warning disable Serilog004 // Constant MessageTemplate verifier

Expand Down
6 changes: 5 additions & 1 deletion src/Serilog/Core/Pipeline/MessageTemplateCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@
// limitations under the License.

using System;
using System.Collections.Generic;
using Serilog.Events;

#if HASHTABLE
using System.Collections;
#else
using System.Collections.Generic;
#endif

namespace Serilog.Core.Pipeline
{
Expand Down
2 changes: 1 addition & 1 deletion src/Serilog/Events/MessageTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
using System.IO;
using System.Linq;
using Serilog.Debugging;
using Serilog.Formatting.Display;
using Serilog.Parsing;
using Serilog.Rendering;

namespace Serilog.Events
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using System.IO;
using Serilog.Events;
using Serilog.Parsing;
using Serilog.Rendering;

namespace Serilog.Formatting.Display
{
Expand Down
2 changes: 1 addition & 1 deletion src/Serilog/Formatting/Json/JsonFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
using System.IO;
using System.Linq;
using Serilog.Events;
using Serilog.Formatting.Display;
using Serilog.Parsing;
using Serilog.Rendering;

namespace Serilog.Formatting.Json
{
Expand Down
2 changes: 1 addition & 1 deletion src/Serilog/LoggerConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Serilog.Capturing;
using Serilog.Configuration;
using Serilog.Core;
using Serilog.Core.Enrichers;
using Serilog.Core.Sinks;
using Serilog.Events;
using Serilog.Parameters;

namespace Serilog
{
Expand Down
2 changes: 1 addition & 1 deletion src/Serilog/Parsing/PropertyToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
using System.Globalization;
using System.IO;
using Serilog.Events;
using Serilog.Formatting.Display;
using Serilog.Rendering;

namespace Serilog.Parsing
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
using System.Collections.Generic;
using System.IO;
using Serilog.Events;
using Serilog.Formatting.Display;
using Serilog.Formatting.Json;
using Serilog.Parsing;

namespace Serilog.Formatting.Display
namespace Serilog.Rendering
{
static class MessageTemplateRenderer
{
Expand Down
4 changes: 0 additions & 4 deletions test/Serilog.PerformanceTests/LevelControlBenchmark.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using Serilog;
using Serilog.Core;
using Serilog.Events;
using System;
using Serilog.PerformanceTests.Support;
using Xunit;

namespace Serilog.PerformanceTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using Serilog;
using Serilog.Context;
using System;
using Serilog.PerformanceTests.Support;
using Xunit;
using Serilog.Events;

namespace Serilog.PerformanceTests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using Serilog;
using Serilog.Events;
using Serilog.Parsing;
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using Xunit;

namespace Serilog.PerformanceTests
{
Expand Down
4 changes: 0 additions & 4 deletions test/Serilog.PerformanceTests/NestedLoggerLatencyBenchmark.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using Serilog;
using System;
using Serilog.PerformanceTests.Support;
using Xunit;
using Serilog.Events;

namespace Serilog.PerformanceTests
Expand Down
8 changes: 0 additions & 8 deletions test/Serilog.PerformanceTests/PipelineBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,8 @@
// limitations under the License.

using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using Serilog;
using Serilog.Events;
using Serilog.Parsing;
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using Serilog.PerformanceTests.Support;
using Xunit;

namespace Serilog.PerformanceTests
{
Expand Down
3 changes: 0 additions & 3 deletions test/Serilog.PerformanceTests/Support/Some.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using Serilog.Events;
using Serilog.Parsing;

Expand Down
2 changes: 1 addition & 1 deletion test/Serilog.Tests/Core/LogEventPropertyCapturingTests.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using System.Linq;
using System.Collections.Generic;
using Serilog.Capturing;
using Serilog.Core;
using Serilog.Debugging;
using Serilog.Events;
using Serilog.Parameters;
using Serilog.Parsing;
using Serilog.Tests.Support;
using Xunit;
Expand Down
2 changes: 1 addition & 1 deletion test/Serilog.Tests/Core/MessageTemplateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
using System.IO;
using System.Linq;
using System.Text;
using Serilog.Capturing;
using Xunit;
using Serilog.Core;
using Serilog.Parameters;
using MessageTemplateParser = Serilog.Parsing.MessageTemplateParser;

namespace Serilog.Tests.Core
Expand Down
13 changes: 7 additions & 6 deletions test/Serilog.Tests/Core/SecondaryLoggerSinkTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using Serilog.Tests.Support;
using Serilog.Tests.Support;
using Xunit;
using Serilog.Core;
using Serilog.Events;
Expand Down Expand Up @@ -37,9 +36,10 @@ public void WhenOwnedByCallerSecondaryLoggerIsNotDisposed()
.WriteTo.Sink(secondary)
.CreateLogger();

((IDisposable)new LoggerConfiguration()
new LoggerConfiguration()
.WriteTo.Logger(secondaryLogger)
.CreateLogger()).Dispose();
.CreateLogger()
.Dispose();

Assert.False(secondary.IsDisposed);
}
Expand All @@ -49,9 +49,10 @@ public void WhenOwnedByPrimaryLoggerSecondaryIsDisposed()
{
var secondary = new DisposeTrackingSink();

((IDisposable)new LoggerConfiguration()
new LoggerConfiguration()
.WriteTo.Logger(lc => lc.WriteTo.Sink(secondary))
.CreateLogger()).Dispose();
.CreateLogger()
.Dispose();

Assert.True(secondary.IsDisposed);
}
Expand Down
2 changes: 1 addition & 1 deletion test/Serilog.Tests/Events/LogEventPropertyValueTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
using System;
using System.Globalization;
using System.Linq;
using Serilog.Capturing;
using Xunit;
using Serilog.Core;
using Serilog.Events;
using Serilog.Parameters;
using Serilog.Parsing;
using Serilog.Tests.Support;

Expand Down
3 changes: 0 additions & 3 deletions test/Serilog.Tests/Formatting/Json/JsonValueFormatterTests.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Serilog.Events;
using Serilog.Formatting.Json;
using Serilog.Tests.Events;
using Serilog.Tests.Support;
using Xunit;

namespace Serilog.Tests.Formatting.Json
Expand Down
Loading

0 comments on commit a74938c

Please sign in to comment.