Skip to content

Commit da767f2

Browse files
committed
Merge remote-tracking branch 'DotNetAnalyzers/master' into resx-generator
2 parents f269ba9 + 84e2324 commit da767f2

1,447 files changed

Lines changed: 14601 additions & 800 deletions

File tree

Some content is hidden

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

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
root = true
22

3+
[*.{csproj,props,targets}]
4+
indent_style = space
5+
indent_size = 2
6+
37
[*.yml]
48
indent_style = space
59
indent_size = 2
@@ -12,6 +16,8 @@ indent_size = 4
1216

1317
# Sort using and Import directives with System.* appearing first
1418
dotnet_sort_system_directives_first = true
19+
dotnet_separate_import_directive_groups = false
20+
csharp_using_directive_placement = inside_namespace:none
1521

1622
# Always use "this." and "Me." when applicable; let StyleCop Analyzers provide the warning and fix
1723
dotnet_style_qualification_for_field = true:none

StyleCop.Analyzers/Directory.Build.props

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
</PropertyGroup>
1111

1212
<PropertyGroup>
13-
<LangVersion>9</LangVersion>
14-
<WarningLevel>5</WarningLevel>
13+
<LangVersion>10</LangVersion>
14+
<Nullable>enable</Nullable>
15+
<WarningLevel>99</WarningLevel>
1516
</PropertyGroup>
1617

1718
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' != 'true'">
@@ -45,18 +46,18 @@
4546
<ItemGroup>
4647
<PackageReference Include="AsyncUsageAnalyzers" Version="1.0.0-alpha003" PrivateAssets="all" />
4748
<PackageReference Include="DotNetAnalyzers.DocumentationAnalyzers" Version="1.0.0-beta.46" PrivateAssets="all" />
48-
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.304" PrivateAssets="all" />
49-
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.0" PrivateAssets="all" />
50-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeStyle" Version="3.8.0" PrivateAssets="all" />
49+
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435" PrivateAssets="all" />
50+
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" PrivateAssets="all" />
51+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeStyle" Version="4.0.1" PrivateAssets="all" />
5152
</ItemGroup>
5253

5354
<ItemGroup>
54-
<PackageReference Include="Microsoft.CodeAnalysis.ResxSourceGenerator" Version="3.3.3-beta1.21202.3" PrivateAssets="all" />
55+
<PackageReference Include="Microsoft.CodeAnalysis.ResxSourceGenerator" Version="3.3.3-beta1.21417.2" PrivateAssets="all" />
5556
</ItemGroup>
5657

5758
<!-- C# Compiler -->
5859
<ItemGroup>
59-
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="3.9.0" PrivateAssets="all" />
60+
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="4.0.1" PrivateAssets="all" />
6061
</ItemGroup>
6162

6263
<!-- Public API -->

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/DocumentationRules/FileHeaderCodeFixProvider.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

4+
#nullable disable
5+
46
namespace StyleCop.Analyzers.DocumentationRules
57
{
68
using System;
@@ -77,7 +79,7 @@ private static async Task<Document> GetTransformedDocumentAsync(Document documen
7779
private static async Task<SyntaxNode> GetTransformedSyntaxRootAsync(Document document, CancellationToken cancellationToken)
7880
{
7981
var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
80-
var settings = document.Project.AnalyzerOptions.GetStyleCopSettings(cancellationToken);
82+
var settings = document.Project.AnalyzerOptions.GetStyleCopSettings(root.SyntaxTree, cancellationToken);
8183

8284
var fileHeader = FileHeaderHelpers.ParseFileHeader(root);
8385
SyntaxNode newSyntaxRoot;
@@ -447,12 +449,12 @@ private static SyntaxTriviaList RemoveHeaderDecorationLines(SyntaxTriviaList tri
447449
for (int i = 0; i < trivia.Count; i++)
448450
{
449451
var triviaLine = trivia[i];
450-
if (triviaLine.Kind() == SyntaxKind.SingleLineCommentTrivia && triviaLine.ToFullString().Contains(settings.DocumentationRules.HeaderDecoration))
452+
if (triviaLine.IsKind(SyntaxKind.SingleLineCommentTrivia) && triviaLine.ToFullString().Contains(settings.DocumentationRules.HeaderDecoration))
451453
{
452454
decorationRemovalList.Add(i);
453455

454456
// also remove the line break
455-
if (i + 1 < trivia.Count && trivia[i + 1].Kind() == SyntaxKind.EndOfLineTrivia)
457+
if (i + 1 < trivia.Count && trivia[i + 1].IsKind(SyntaxKind.EndOfLineTrivia))
456458
{
457459
decorationRemovalList.Add(i + 1);
458460
}

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/DocumentationRules/InheritdocCodeFixProvider.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

4+
#nullable disable
5+
46
namespace StyleCop.Analyzers.DocumentationRules
57
{
68
using System.Collections.Immutable;

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/DocumentationRules/PropertySummaryDocumentationCodeFixProvider.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

4+
#nullable disable
5+
46
namespace StyleCop.Analyzers.DocumentationRules
57
{
68
using System.Collections.Immutable;

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/DocumentationRules/SA1600CodeFixProvider.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

4+
#nullable disable
5+
46
namespace StyleCop.Analyzers.DocumentationRules
57
{
68
using System.Collections.Generic;

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/DocumentationRules/SA1609SA1610CodeFixProvider.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

4+
#nullable disable
5+
46
namespace StyleCop.Analyzers.DocumentationRules
57
{
68
using System;

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/DocumentationRules/SA1615SA1616CodeFixProvider.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

4+
#nullable disable
5+
46
namespace StyleCop.Analyzers.DocumentationRules
57
{
68
using System;

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/DocumentationRules/SA1617CodeFixProvider.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

4+
#nullable disable
5+
46
namespace StyleCop.Analyzers.DocumentationRules
57
{
68
using System.Collections.Generic;

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/DocumentationRules/SA1626CodeFixProvider.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

4+
#nullable disable
5+
46
namespace StyleCop.Analyzers.DocumentationRules
57
{
68
using System.Collections.Generic;

0 commit comments

Comments
 (0)