Skip to content

Commit ce191c9

Browse files
committed
Merge branch 'master' into SyntaxKindEx-PatternsAndInitOnly
2 parents 074180c + f5843ae commit ce191c9

File tree

2,923 files changed

+33159
-15133
lines changed

Some content is hidden

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

2,923 files changed

+33159
-15133
lines changed

.editorconfig

Lines changed: 4 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

.nuget/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Codecov" version="1.9.0" />
3+
<package id="CodecovUploader" version="0.7.1" />
44
<package id="OpenCover" version="4.6.519" />
5-
<package id="ReportGenerator" version="2.3.5.0" targetFramework="net452" />
5+
<package id="ReportGenerator" version="5.2.0" />
66
<package id="xunit.runner.console" version="2.4.1" />
77
</packages>

NuGet.config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
66
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
77
<add key="dotnet5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" />
8+
<add key="dotnet8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" />
9+
<add key="dotnet9" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json" />
810

911
<!-- Uncomment this to test unpublished builds from the AppVeyor feed. -->
1012
<!--<add key="appveyor-stylecop" value="https://ci.appveyor.com/nuget/stylecopanalyzers" />-->

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
[![Build status](https://ci.appveyor.com/api/projects/status/8jw2lq431kgg44jl/branch/master?svg=true)](https://ci.appveyor.com/project/sharwell/stylecopanalyzers/branch/master)
88

9-
[![codecov.io](http://codecov.io/github/DotNetAnalyzers/StyleCopAnalyzers/coverage.svg?branch=master)](http://codecov.io/github/DotNetAnalyzers/StyleCopAnalyzers?branch=master)
9+
[![codecov.io](https://codecov.io/github/DotNetAnalyzers/StyleCopAnalyzers/coverage.svg?branch=master)](https://codecov.io/github/DotNetAnalyzers/StyleCopAnalyzers?branch=master)
1010

1111
This repository contains an implementation of the StyleCop rules using the .NET Compiler Platform. Where possible, code fixes are also provided to simplify the process of correcting violations.
1212

StyleCop.Analyzers/Directory.Build.props

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
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>
16+
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
1517
</PropertyGroup>
1618

1719
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' != 'true'">
@@ -38,26 +40,34 @@
3840
<NoWarn>$(NoWarn),1573,1591,1712</NoWarn>
3941
</PropertyGroup>
4042

43+
<PropertyGroup>
44+
<SharedMicrosoftCodeAnalysisAnalyzersVersion>3.11.0-beta1.24052.1</SharedMicrosoftCodeAnalysisAnalyzersVersion>
45+
</PropertyGroup>
46+
4147
<ItemGroup>
4248
<PackageReference Include="Nerdbank.GitVersioning" Version="2.2.13" PrivateAssets="all" />
4349
</ItemGroup>
4450

4551
<ItemGroup>
4652
<PackageReference Include="AsyncUsageAnalyzers" Version="1.0.0-alpha003" PrivateAssets="all" />
4753
<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" />
54+
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" PrivateAssets="all" />
55+
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="$(SharedMicrosoftCodeAnalysisAnalyzersVersion)" PrivateAssets="all" />
56+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeStyle" Version="4.0.1" PrivateAssets="all" />
57+
</ItemGroup>
58+
59+
<ItemGroup>
60+
<PackageReference Include="Microsoft.CodeAnalysis.ResxSourceGenerator" Version="$(SharedMicrosoftCodeAnalysisAnalyzersVersion)" PrivateAssets="all" />
5161
</ItemGroup>
5262

5363
<!-- C# Compiler -->
5464
<ItemGroup>
55-
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="3.8.0" PrivateAssets="all" />
65+
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="4.0.1" PrivateAssets="all" />
5666
</ItemGroup>
5767

5868
<!-- Public API -->
5969
<ItemGroup>
60-
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="2.9.7" PrivateAssets="all" />
70+
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="$(SharedMicrosoftCodeAnalysisAnalyzersVersion)" PrivateAssets="all" />
6171
</ItemGroup>
6272

6373
<ItemGroup>

StyleCop.Analyzers/Directory.Build.targets

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
33

4-
<ItemGroup>
5-
<!-- Enable code generation for resource files -->
6-
<CodeGenerationEmbeddedResource Include="@(EmbeddedResource)" Exclude="**\*.??-??.resx" />
7-
<EmbeddedResource Update="@(CodeGenerationEmbeddedResource)" Generator="ResXFileCodeGenerator" />
8-
</ItemGroup>
9-
10-
<!-- Special handling for embedded resources and generated files to show as nested in Solution Explorer -->
11-
<ItemGroup>
12-
<!-- Update designer files for *.resx files -->
13-
<Compile Update="@(CodeGenerationEmbeddedResource->'%(RecursiveDir)%(Filename).Designer.cs')" DependentUpon="$([System.IO.Path]::ChangeExtension($([System.IO.Path]::GetFileNameWithoutExtension(%(Identity))), '.resx'))" />
14-
15-
<!-- Localized embedded resources are just dependent on the parent RESX -->
16-
<EmbeddedResource Update="**\*.??-??.resx" DependentUpon="$([System.IO.Path]::ChangeExtension($([System.IO.Path]::GetFileNameWithoutExtension(%(Identity))), '.resx'))" />
17-
</ItemGroup>
18-
194
<ItemGroup>
205
<None Include="$(MSBuildProjectFileDirectory)$(AssemblyOriginatorKeyFile)" Link="%(Filename)%(Extension)" />
216
</ItemGroup>

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(root.SyntaxTree, cancellationToken);
82+
var settings = document.Project.AnalyzerOptions.GetStyleCopSettingsInCodeFix(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;

0 commit comments

Comments
 (0)