Skip to content

Commit 2ccb83c

Browse files
committed
file scoped namespaces
1 parent ac37d68 commit 2ccb83c

File tree

288 files changed

+15883
-16171
lines changed

Some content is hidden

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

288 files changed

+15883
-16171
lines changed
Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,38 @@
1-
namespace PropertyChangedAnalyzers.Benchmarks
2-
{
3-
using System;
4-
using System.Collections.Generic;
5-
using System.Linq;
6-
using Microsoft.CodeAnalysis.Diagnostics;
7-
using NUnit.Framework;
8-
using PropertyChangedAnalyzers.Benchmarks.Benchmarks;
1+
namespace PropertyChangedAnalyzers.Benchmarks;
92

10-
public class BenchmarkTests
11-
{
12-
private static IReadOnlyList<DiagnosticAnalyzer> AllAnalyzers { get; } =
13-
typeof(KnownSymbol)
14-
.Assembly
15-
.GetTypes()
16-
.Where(t => typeof(DiagnosticAnalyzer).IsAssignableFrom(t) && !t.IsAbstract)
17-
.Select(t => (DiagnosticAnalyzer)Activator.CreateInstance(t))
18-
.ToArray();
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Linq;
6+
using Microsoft.CodeAnalysis.Diagnostics;
7+
using NUnit.Framework;
8+
using PropertyChangedAnalyzers.Benchmarks.Benchmarks;
199

20-
private static IReadOnlyList<Gu.Roslyn.Asserts.Benchmark> AllBenchmarks { get; } = AllAnalyzers
21-
.Select(x => Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, x))
22-
.ToArray();
10+
public class BenchmarkTests
11+
{
12+
private static IReadOnlyList<DiagnosticAnalyzer> AllAnalyzers { get; } =
13+
typeof(KnownSymbol)
14+
.Assembly
15+
.GetTypes()
16+
.Where(t => typeof(DiagnosticAnalyzer).IsAssignableFrom(t) && !t.IsAbstract)
17+
.Select(t => (DiagnosticAnalyzer)Activator.CreateInstance(t))
18+
.ToArray();
2319

24-
[OneTimeSetUp]
25-
public void OneTimeSetUp()
26-
{
27-
foreach (var benchmark in AllBenchmarks)
28-
{
29-
benchmark.Run();
30-
}
31-
}
20+
private static IReadOnlyList<Gu.Roslyn.Asserts.Benchmark> AllBenchmarks { get; } = AllAnalyzers
21+
.Select(x => Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, x))
22+
.ToArray();
3223

33-
[TestCaseSource(nameof(AllBenchmarks))]
34-
public void Run(Gu.Roslyn.Asserts.Benchmark benchmark)
24+
[OneTimeSetUp]
25+
public void OneTimeSetUp()
26+
{
27+
foreach (var benchmark in AllBenchmarks)
3528
{
3629
benchmark.Run();
3730
}
3831
}
32+
33+
[TestCaseSource(nameof(AllBenchmarks))]
34+
public void Run(Gu.Roslyn.Asserts.Benchmark benchmark)
35+
{
36+
benchmark.Run();
37+
}
3938
}
Lines changed: 63 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,86 @@
11
// ReSharper disable RedundantNameQualifier
2-
namespace PropertyChangedAnalyzers.Benchmarks.Benchmarks
2+
namespace PropertyChangedAnalyzers.Benchmarks.Benchmarks;
3+
4+
[BenchmarkDotNet.Attributes.MemoryDiagnoser]
5+
public class AllBenchmarks
36
{
4-
[BenchmarkDotNet.Attributes.MemoryDiagnoser]
5-
public class AllBenchmarks
6-
{
7-
private static readonly Gu.Roslyn.Asserts.Benchmark ArgumentAnalyzerBenchmark = Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, new PropertyChangedAnalyzers.ArgumentAnalyzer());
7+
private static readonly Gu.Roslyn.Asserts.Benchmark ArgumentAnalyzerBenchmark = Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, new PropertyChangedAnalyzers.ArgumentAnalyzer());
88

9-
private static readonly Gu.Roslyn.Asserts.Benchmark AssignmentAnalyzerBenchmark = Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, new PropertyChangedAnalyzers.AssignmentAnalyzer());
9+
private static readonly Gu.Roslyn.Asserts.Benchmark AssignmentAnalyzerBenchmark = Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, new PropertyChangedAnalyzers.AssignmentAnalyzer());
1010

11-
private static readonly Gu.Roslyn.Asserts.Benchmark ClassDeclarationAnalyzerBenchmark = Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, new PropertyChangedAnalyzers.ClassDeclarationAnalyzer());
11+
private static readonly Gu.Roslyn.Asserts.Benchmark ClassDeclarationAnalyzerBenchmark = Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, new PropertyChangedAnalyzers.ClassDeclarationAnalyzer());
1212

13-
private static readonly Gu.Roslyn.Asserts.Benchmark EventAnalyzerBenchmark = Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, new PropertyChangedAnalyzers.EventAnalyzer());
13+
private static readonly Gu.Roslyn.Asserts.Benchmark EventAnalyzerBenchmark = Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, new PropertyChangedAnalyzers.EventAnalyzer());
1414

15-
private static readonly Gu.Roslyn.Asserts.Benchmark InvocationAnalyzerBenchmark = Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, new PropertyChangedAnalyzers.InvocationAnalyzer());
15+
private static readonly Gu.Roslyn.Asserts.Benchmark InvocationAnalyzerBenchmark = Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, new PropertyChangedAnalyzers.InvocationAnalyzer());
1616

17-
private static readonly Gu.Roslyn.Asserts.Benchmark MethodDeclarationAnalyzerBenchmark = Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, new PropertyChangedAnalyzers.MethodDeclarationAnalyzer());
17+
private static readonly Gu.Roslyn.Asserts.Benchmark MethodDeclarationAnalyzerBenchmark = Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, new PropertyChangedAnalyzers.MethodDeclarationAnalyzer());
1818

19-
private static readonly Gu.Roslyn.Asserts.Benchmark MutationAnalyzerBenchmark = Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, new PropertyChangedAnalyzers.MutationAnalyzer());
19+
private static readonly Gu.Roslyn.Asserts.Benchmark MutationAnalyzerBenchmark = Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, new PropertyChangedAnalyzers.MutationAnalyzer());
2020

21-
private static readonly Gu.Roslyn.Asserts.Benchmark PropertyDeclarationAnalyzerBenchmark = Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, new PropertyChangedAnalyzers.PropertyDeclarationAnalyzer());
21+
private static readonly Gu.Roslyn.Asserts.Benchmark PropertyDeclarationAnalyzerBenchmark = Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, new PropertyChangedAnalyzers.PropertyDeclarationAnalyzer());
2222

23-
private static readonly Gu.Roslyn.Asserts.Benchmark SetAccessorAnalyzerBenchmark = Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, new PropertyChangedAnalyzers.SetAccessorAnalyzer());
23+
private static readonly Gu.Roslyn.Asserts.Benchmark SetAccessorAnalyzerBenchmark = Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, new PropertyChangedAnalyzers.SetAccessorAnalyzer());
2424

25-
private static readonly Gu.Roslyn.Asserts.Benchmark StructAnalyzerBenchmark = Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, new PropertyChangedAnalyzers.StructAnalyzer());
25+
private static readonly Gu.Roslyn.Asserts.Benchmark StructAnalyzerBenchmark = Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, new PropertyChangedAnalyzers.StructAnalyzer());
2626

27-
[BenchmarkDotNet.Attributes.Benchmark]
28-
public void ArgumentAnalyzer()
29-
{
30-
ArgumentAnalyzerBenchmark.Run();
31-
}
27+
[BenchmarkDotNet.Attributes.Benchmark]
28+
public void ArgumentAnalyzer()
29+
{
30+
ArgumentAnalyzerBenchmark.Run();
31+
}
3232

33-
[BenchmarkDotNet.Attributes.Benchmark]
34-
public void AssignmentAnalyzer()
35-
{
36-
AssignmentAnalyzerBenchmark.Run();
37-
}
33+
[BenchmarkDotNet.Attributes.Benchmark]
34+
public void AssignmentAnalyzer()
35+
{
36+
AssignmentAnalyzerBenchmark.Run();
37+
}
3838

39-
[BenchmarkDotNet.Attributes.Benchmark]
40-
public void ClassDeclarationAnalyzer()
41-
{
42-
ClassDeclarationAnalyzerBenchmark.Run();
43-
}
39+
[BenchmarkDotNet.Attributes.Benchmark]
40+
public void ClassDeclarationAnalyzer()
41+
{
42+
ClassDeclarationAnalyzerBenchmark.Run();
43+
}
4444

45-
[BenchmarkDotNet.Attributes.Benchmark]
46-
public void EventAnalyzer()
47-
{
48-
EventAnalyzerBenchmark.Run();
49-
}
45+
[BenchmarkDotNet.Attributes.Benchmark]
46+
public void EventAnalyzer()
47+
{
48+
EventAnalyzerBenchmark.Run();
49+
}
5050

51-
[BenchmarkDotNet.Attributes.Benchmark]
52-
public void InvocationAnalyzer()
53-
{
54-
InvocationAnalyzerBenchmark.Run();
55-
}
51+
[BenchmarkDotNet.Attributes.Benchmark]
52+
public void InvocationAnalyzer()
53+
{
54+
InvocationAnalyzerBenchmark.Run();
55+
}
5656

57-
[BenchmarkDotNet.Attributes.Benchmark]
58-
public void MethodDeclarationAnalyzer()
59-
{
60-
MethodDeclarationAnalyzerBenchmark.Run();
61-
}
57+
[BenchmarkDotNet.Attributes.Benchmark]
58+
public void MethodDeclarationAnalyzer()
59+
{
60+
MethodDeclarationAnalyzerBenchmark.Run();
61+
}
6262

63-
[BenchmarkDotNet.Attributes.Benchmark]
64-
public void MutationAnalyzer()
65-
{
66-
MutationAnalyzerBenchmark.Run();
67-
}
63+
[BenchmarkDotNet.Attributes.Benchmark]
64+
public void MutationAnalyzer()
65+
{
66+
MutationAnalyzerBenchmark.Run();
67+
}
6868

69-
[BenchmarkDotNet.Attributes.Benchmark]
70-
public void PropertyDeclarationAnalyzer()
71-
{
72-
PropertyDeclarationAnalyzerBenchmark.Run();
73-
}
69+
[BenchmarkDotNet.Attributes.Benchmark]
70+
public void PropertyDeclarationAnalyzer()
71+
{
72+
PropertyDeclarationAnalyzerBenchmark.Run();
73+
}
7474

75-
[BenchmarkDotNet.Attributes.Benchmark]
76-
public void SetAccessorAnalyzer()
77-
{
78-
SetAccessorAnalyzerBenchmark.Run();
79-
}
75+
[BenchmarkDotNet.Attributes.Benchmark]
76+
public void SetAccessorAnalyzer()
77+
{
78+
SetAccessorAnalyzerBenchmark.Run();
79+
}
8080

81-
[BenchmarkDotNet.Attributes.Benchmark]
82-
public void StructAnalyzer()
83-
{
84-
StructAnalyzerBenchmark.Run();
85-
}
81+
[BenchmarkDotNet.Attributes.Benchmark]
82+
public void StructAnalyzer()
83+
{
84+
StructAnalyzerBenchmark.Run();
8685
}
8786
}
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
// ReSharper disable RedundantNameQualifier
2-
namespace PropertyChangedAnalyzers.Benchmarks.Benchmarks
2+
namespace PropertyChangedAnalyzers.Benchmarks.Benchmarks;
3+
4+
[BenchmarkDotNet.Attributes.MemoryDiagnoser]
5+
public class ArgumentAnalyzerBenchmarks
36
{
4-
[BenchmarkDotNet.Attributes.MemoryDiagnoser]
5-
public class ArgumentAnalyzerBenchmarks
6-
{
7-
private static readonly Gu.Roslyn.Asserts.Benchmark Benchmark = Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, new PropertyChangedAnalyzers.ArgumentAnalyzer());
7+
private static readonly Gu.Roslyn.Asserts.Benchmark Benchmark = Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, new PropertyChangedAnalyzers.ArgumentAnalyzer());
88

9-
[BenchmarkDotNet.Attributes.Benchmark]
10-
public void RunOnValidCodeProject()
11-
{
12-
Benchmark.Run();
13-
}
9+
[BenchmarkDotNet.Attributes.Benchmark]
10+
public void RunOnValidCodeProject()
11+
{
12+
Benchmark.Run();
1413
}
1514
}
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
// ReSharper disable RedundantNameQualifier
2-
namespace PropertyChangedAnalyzers.Benchmarks.Benchmarks
2+
namespace PropertyChangedAnalyzers.Benchmarks.Benchmarks;
3+
4+
[BenchmarkDotNet.Attributes.MemoryDiagnoser]
5+
public class AssignmentAnalyzerBenchmarks
36
{
4-
[BenchmarkDotNet.Attributes.MemoryDiagnoser]
5-
public class AssignmentAnalyzerBenchmarks
6-
{
7-
private static readonly Gu.Roslyn.Asserts.Benchmark Benchmark = Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, new PropertyChangedAnalyzers.AssignmentAnalyzer());
7+
private static readonly Gu.Roslyn.Asserts.Benchmark Benchmark = Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, new PropertyChangedAnalyzers.AssignmentAnalyzer());
88

9-
[BenchmarkDotNet.Attributes.Benchmark]
10-
public void RunOnValidCodeProject()
11-
{
12-
Benchmark.Run();
13-
}
9+
[BenchmarkDotNet.Attributes.Benchmark]
10+
public void RunOnValidCodeProject()
11+
{
12+
Benchmark.Run();
1413
}
1514
}
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
// ReSharper disable RedundantNameQualifier
2-
namespace PropertyChangedAnalyzers.Benchmarks.Benchmarks
2+
namespace PropertyChangedAnalyzers.Benchmarks.Benchmarks;
3+
4+
[BenchmarkDotNet.Attributes.MemoryDiagnoser]
5+
public class ClassDeclarationAnalyzerBenchmarks
36
{
4-
[BenchmarkDotNet.Attributes.MemoryDiagnoser]
5-
public class ClassDeclarationAnalyzerBenchmarks
6-
{
7-
private static readonly Gu.Roslyn.Asserts.Benchmark Benchmark = Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, new PropertyChangedAnalyzers.ClassDeclarationAnalyzer());
7+
private static readonly Gu.Roslyn.Asserts.Benchmark Benchmark = Gu.Roslyn.Asserts.Benchmark.Create(Code.ValidCodeProject, new PropertyChangedAnalyzers.ClassDeclarationAnalyzer());
88

9-
[BenchmarkDotNet.Attributes.Benchmark]
10-
public void RunOnValidCodeProject()
11-
{
12-
Benchmark.Run();
13-
}
9+
[BenchmarkDotNet.Attributes.Benchmark]
10+
public void RunOnValidCodeProject()
11+
{
12+
Benchmark.Run();
1413
}
1514
}
Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
namespace PropertyChangedAnalyzers.Benchmarks.Benchmarks
2-
{
3-
using System.IO;
4-
using Gu.Roslyn.Asserts;
1+
namespace PropertyChangedAnalyzers.Benchmarks.Benchmarks;
2+
3+
using System.IO;
4+
using Gu.Roslyn.Asserts;
55

6-
using Microsoft.CodeAnalysis;
6+
using Microsoft.CodeAnalysis;
77

8-
public static class Code
9-
{
10-
public static string ProjectDirectory { get; } = ProjectFile.Find("PropertyChangedAnalyzers.Benchmarks.csproj").DirectoryName;
8+
public static class Code
9+
{
10+
public static string ProjectDirectory { get; } = ProjectFile.Find("PropertyChangedAnalyzers.Benchmarks.csproj").DirectoryName;
1111

12-
public static string BenchmarksDirectory { get; } = Path.Combine(ProjectDirectory, "Benchmarks");
12+
public static string BenchmarksDirectory { get; } = Path.Combine(ProjectDirectory, "Benchmarks");
1313

14-
public static Solution ValidCodeProject { get; } = CodeFactory.CreateSolution(ProjectFile.Find("ValidCode.csproj"));
15-
}
14+
public static Solution ValidCodeProject { get; } = CodeFactory.CreateSolution(ProjectFile.Find("ValidCode.csproj"));
1615
}

0 commit comments

Comments
 (0)