Skip to content

Commit bf642c4

Browse files
author
bart-degreed
committed
Updated code formatting settings and reformatted solution
1 parent f96fb3b commit bf642c4

File tree

71 files changed

+630
-1003
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+630
-1003
lines changed

src/CSharpGuidelinesAnalyzer.sln.DotSettings

Lines changed: 45 additions & 27 deletions
Large diffs are not rendered by default.

src/CSharpGuidelinesAnalyzer/CSharpGuidelinesAnalyzer.Test/Specs/Maintainability/AvoidMemberWithManyStatementsSpecs.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2982,8 +2982,7 @@ class C
29822982

29832983
// Assert
29842984
action.Should().Throw<Exception>()
2985-
.WithMessage(
2986-
"*Value for 'AV1500:MaxStatementCount' in 'CSharpGuidelinesAnalyzer.config' must be in range 0-255.*");
2985+
.WithMessage("*Value for 'AV1500:MaxStatementCount' in 'CSharpGuidelinesAnalyzer.config' must be in range 0-255.*");
29872986
}
29882987

29892988
[Fact]
@@ -3012,8 +3011,7 @@ class C
30123011

30133012
// Assert
30143013
action.Should().Throw<Exception>()
3015-
.WithMessage(
3016-
"*Value for 'dotnet_diagnostic.av1500.max_statement_count' in '.editorconfig' must be in range 0-255.*");
3014+
.WithMessage("*Value for 'dotnet_diagnostic.av1500.max_statement_count' in '.editorconfig' must be in range 0-255.*");
30173015
}
30183016

30193017
[Fact]
@@ -3042,8 +3040,7 @@ class C
30423040

30433041
// Assert
30443042
action.Should().Throw<Exception>()
3045-
.WithMessage(
3046-
"*Value for 'AV1500:MaxStatementCount' in 'CSharpGuidelinesAnalyzer.config' must be in range 0-255.*");
3043+
.WithMessage("*Value for 'AV1500:MaxStatementCount' in 'CSharpGuidelinesAnalyzer.config' must be in range 0-255.*");
30473044
}
30483045

30493046
[Fact]
@@ -3072,8 +3069,7 @@ class C
30723069

30733070
// Assert
30743071
action.Should().Throw<Exception>()
3075-
.WithMessage(
3076-
"*Value for 'dotnet_diagnostic.av1500.max_statement_count' in '.editorconfig' must be in range 0-255.*");
3072+
.WithMessage("*Value for 'dotnet_diagnostic.av1500.max_statement_count' in '.editorconfig' must be in range 0-255.*");
30773073
}
30783074

30793075
#endregion

src/CSharpGuidelinesAnalyzer/CSharpGuidelinesAnalyzer.Test/Specs/Maintainability/AvoidSignatureWithManyParametersSpecs.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -886,8 +886,7 @@ internal void When_xml_setting_value_is_out_of_range_it_must_fail()
886886

887887
// Assert
888888
action.Should().Throw<Exception>()
889-
.WithMessage(
890-
"*Value for 'AV1561:MaxParameterCount' in 'CSharpGuidelinesAnalyzer.config' must be in range 0-255.*");
889+
.WithMessage("*Value for 'AV1561:MaxParameterCount' in 'CSharpGuidelinesAnalyzer.config' must be in range 0-255.*");
891890
}
892891

893892
[Fact]
@@ -910,8 +909,7 @@ internal void When_editor_config_setting_value_is_out_of_range_it_must_fail()
910909

911910
// Assert
912911
action.Should().Throw<Exception>()
913-
.WithMessage(
914-
"*Value for 'dotnet_diagnostic.av1561.max_parameter_count' in '.editorconfig' must be in range 0-255.*");
912+
.WithMessage("*Value for 'dotnet_diagnostic.av1561.max_parameter_count' in '.editorconfig' must be in range 0-255.*");
915913
}
916914

917915
[Fact]
@@ -934,8 +932,7 @@ internal void When_xml_constructor_setting_value_is_out_of_range_it_must_fail()
934932

935933
// Assert
936934
action.Should().Throw<Exception>()
937-
.WithMessage(
938-
"*Value for 'AV1561:MaxConstructorParameterCount' in 'CSharpGuidelinesAnalyzer.config' must be in range 0-255.*");
935+
.WithMessage("*Value for 'AV1561:MaxConstructorParameterCount' in 'CSharpGuidelinesAnalyzer.config' must be in range 0-255.*");
939936
}
940937

941938
[Fact]
@@ -958,8 +955,7 @@ internal void When_editor_config_constructor_setting_value_is_out_of_range_it_mu
958955

959956
// Assert
960957
action.Should().Throw<Exception>()
961-
.WithMessage(
962-
"*Value for 'dotnet_diagnostic.av1561.max_constructor_parameter_count' in '.editorconfig' must be in range 0-255.*");
958+
.WithMessage("*Value for 'dotnet_diagnostic.av1561.max_constructor_parameter_count' in '.editorconfig' must be in range 0-255.*");
963959
}
964960

965961
#endregion

src/CSharpGuidelinesAnalyzer/CSharpGuidelinesAnalyzer/AnalyzerCategory.cs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,16 @@ internal sealed class AnalyzerCategory
77
private const string CommitHash = "7a66f7468da6ce1477753a02e416e04bc9a44e45";
88

99
[NotNull]
10-
public static readonly AnalyzerCategory ClassDesign =
11-
new AnalyzerCategory("Class Design", "1000_ClassDesignGuidelines.md");
10+
public static readonly AnalyzerCategory ClassDesign = new AnalyzerCategory("Class Design", "1000_ClassDesignGuidelines.md");
1211

1312
[NotNull]
14-
public static readonly AnalyzerCategory MemberDesign =
15-
new AnalyzerCategory("Member Design", "1100_MemberDesignGuidelines.md");
13+
public static readonly AnalyzerCategory MemberDesign = new AnalyzerCategory("Member Design", "1100_MemberDesignGuidelines.md");
1614

1715
[NotNull]
18-
public static readonly AnalyzerCategory MiscellaneousDesign =
19-
new AnalyzerCategory("Miscellaneous Design", "1200_MiscellaneousDesignGuidelines.md");
16+
public static readonly AnalyzerCategory MiscellaneousDesign = new AnalyzerCategory("Miscellaneous Design", "1200_MiscellaneousDesignGuidelines.md");
2017

2118
[NotNull]
22-
public static readonly AnalyzerCategory Maintainability =
23-
new AnalyzerCategory("Maintainability", "1500_MaintainabilityGuidelines.md");
19+
public static readonly AnalyzerCategory Maintainability = new AnalyzerCategory("Maintainability", "1500_MaintainabilityGuidelines.md");
2420

2521
[NotNull]
2622
public static readonly AnalyzerCategory Naming = new AnalyzerCategory("Naming", "1700_NamingGuidelines.md");
@@ -29,8 +25,7 @@ internal sealed class AnalyzerCategory
2925
public static readonly AnalyzerCategory Framework = new AnalyzerCategory("Framework", "2200_FrameworkGuidelines.md");
3026

3127
[NotNull]
32-
public static readonly AnalyzerCategory Documentation =
33-
new AnalyzerCategory("Documentation", "2300_DocumentationGuidelines.md");
28+
public static readonly AnalyzerCategory Documentation = new AnalyzerCategory("Documentation", "2300_DocumentationGuidelines.md");
3429

3530
[NotNull]
3631
public static readonly AnalyzerCategory Layout = new AnalyzerCategory("Layout", "2400_LayoutGuidelines.md");

src/CSharpGuidelinesAnalyzer/CSharpGuidelinesAnalyzer/BaseAnalysisContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ internal struct BaseAnalysisContext<TTarget>
2828
[NotNull]
2929
public TTarget Target { get; }
3030

31-
public BaseAnalysisContext([NotNull] Compilation compilation, [NotNull] AnalyzerOptions options,
32-
CancellationToken cancellationToken, [NotNull] Action<Diagnostic> reportDiagnostic, [NotNull] TTarget target)
31+
public BaseAnalysisContext([NotNull] Compilation compilation, [NotNull] AnalyzerOptions options, CancellationToken cancellationToken,
32+
[NotNull] Action<Diagnostic> reportDiagnostic, [NotNull] TTarget target)
3333
{
3434
Guard.NotNull(compilation, nameof(compilation));
3535
Guard.NotNull(options, nameof(options));

src/CSharpGuidelinesAnalyzer/CSharpGuidelinesAnalyzer/Extensions/AnalysisContextExtensions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ public static void SkipInvalid(this OperationAnalysisContext context, [NotNull]
1616
}
1717
}
1818

19-
public static void SkipInvalid(this OperationBlockAnalysisContext context,
20-
[NotNull] Action<OperationBlockAnalysisContext> action)
19+
public static void SkipInvalid(this OperationBlockAnalysisContext context, [NotNull] Action<OperationBlockAnalysisContext> action)
2120
{
2221
if (!context.OperationBlocks.Any(block => block.HasErrors(context.Compilation, context.CancellationToken)))
2322
{

src/CSharpGuidelinesAnalyzer/CSharpGuidelinesAnalyzer/Extensions/BaseAnalysisContextExtensions.cs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,22 @@ internal static class BaseAnalysisContextExtensions
77
{
88
public static BaseAnalysisContext<TTarget> Wrap<TTarget>(this SyntaxNodeAnalysisContext context, [NotNull] TTarget target)
99
{
10-
return new BaseAnalysisContext<TTarget>(context.Compilation, context.Options, context.CancellationToken,
11-
context.ReportDiagnostic, target);
10+
return new BaseAnalysisContext<TTarget>(context.Compilation, context.Options, context.CancellationToken, context.ReportDiagnostic, target);
1211
}
1312

1413
public static BaseAnalysisContext<TTarget> Wrap<TTarget>(this SymbolAnalysisContext context, [NotNull] TTarget target)
1514
{
16-
return new BaseAnalysisContext<TTarget>(context.Compilation, context.Options, context.CancellationToken,
17-
context.ReportDiagnostic, target);
15+
return new BaseAnalysisContext<TTarget>(context.Compilation, context.Options, context.CancellationToken, context.ReportDiagnostic, target);
1816
}
1917

20-
public static BaseAnalysisContext<TTarget> Wrap<TTarget>(this CompilationAnalysisContext context,
21-
[NotNull] TTarget target)
18+
public static BaseAnalysisContext<TTarget> Wrap<TTarget>(this CompilationAnalysisContext context, [NotNull] TTarget target)
2219
{
23-
return new BaseAnalysisContext<TTarget>(context.Compilation, context.Options, context.CancellationToken,
24-
context.ReportDiagnostic, target);
20+
return new BaseAnalysisContext<TTarget>(context.Compilation, context.Options, context.CancellationToken, context.ReportDiagnostic, target);
2521
}
2622

2723
public static BaseAnalysisContext<TTarget> Wrap<TTarget>(this OperationAnalysisContext context, [NotNull] TTarget target)
2824
{
29-
return new BaseAnalysisContext<TTarget>(context.Compilation, context.Options, context.CancellationToken,
30-
context.ReportDiagnostic, target);
25+
return new BaseAnalysisContext<TTarget>(context.Compilation, context.Options, context.CancellationToken, context.ReportDiagnostic, target);
3126
}
3227
}
3328
}

src/CSharpGuidelinesAnalyzer/CSharpGuidelinesAnalyzer/Extensions/IdentifierExtensions.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ namespace CSharpGuidelinesAnalyzer.Extensions
1010
internal static class IdentifierExtensions
1111
{
1212
[NotNull]
13-
public static ICollection<WordToken> GetWordsInList([NotNull] this string identifierName,
14-
[NotNull] [ItemNotNull] ICollection<string> list)
13+
public static ICollection<WordToken> GetWordsInList([NotNull] this string identifierName, [NotNull] [ItemNotNull] ICollection<string> list)
1514
{
1615
Guard.NotNull(identifierName, nameof(identifierName));
1716
Guard.NotNullNorEmpty(list, nameof(list));
@@ -56,8 +55,7 @@ private static bool TokenSetContainsWordInTheMiddle([NotNull] IReadOnlyList<Word
5655
return false;
5756
}
5857

59-
public static bool StartsWithWordInList([NotNull] this string identifierName,
60-
[NotNull] [ItemNotNull] ICollection<string> list)
58+
public static bool StartsWithWordInList([NotNull] this string identifierName, [NotNull] [ItemNotNull] ICollection<string> list)
6159
{
6260
Guard.NotNull(identifierName, nameof(identifierName));
6361
Guard.NotNullNorEmpty(list, nameof(list));
@@ -73,8 +71,7 @@ public static bool StartsWithWordInList([NotNull] this string identifierName,
7371
return words.Any() && IsListed(words.First(), list);
7472
}
7573

76-
private static bool QuickScanMayContainWordsListed([NotNull] string text,
77-
[NotNull] [ItemNotNull] IEnumerable<string> list)
74+
private static bool QuickScanMayContainWordsListed([NotNull] string text, [NotNull] [ItemNotNull] IEnumerable<string> list)
7875
{
7976
return list.Any(word => QuickScanMayContainWord(text, word));
8077
}

0 commit comments

Comments
 (0)