Skip to content

Commit 477c0fe

Browse files
committed
Merge branch 'master' into namespace-casing
2 parents f97a713 + dc78ed3 commit 477c0fe

File tree

312 files changed

+10120
-1144
lines changed

Some content is hidden

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

312 files changed

+10120
-1144
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+
[*.yml]
4+
indent_style = space
5+
indent_size = 2
6+
37
[*.cs]
48
charset = utf-8-bom
59
insert_final_newline = true

.nuget/packages.config

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Codecov" version="1.1.0" />
4-
<package id="Microsoft.DiaSymReader.Pdb2Pdb" version="1.1.0-beta1-62624-01" />
3+
<package id="Codecov" version="1.9.0" />
54
<package id="OpenCover" version="4.6.519" />
65
<package id="ReportGenerator" version="2.3.5.0" targetFramework="net452" />
7-
<package id="xunit.runner.console" version="2.1.0" targetFramework="net452" />
6+
<package id="xunit.runner.console" version="2.4.1" />
87
</packages>

NuGet.config

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<packageSources>
4+
<clear />
5+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
46
<add key="roslyn" value="https://dotnet.myget.org/F/roslyn/api/v3/index.json" />
57
<add key="roslyn-analyzers" value="https://dotnet.myget.org/F/roslyn-analyzers/api/v3/index.json" />
6-
<add key="symreader-converter" value="https://dotnet.myget.org/F/symreader-converter/api/v3/index.json" />
78

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

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ Not all versions of StyleCop.Analyzers support all features of each C# language
2929

3030
| C# version | StyleCop.Analyzers version | Visual Studio version |
3131
|------------|----------------------------|-----------------------|
32-
| 1.0 - 6.0 | v1.0.2 or higher | VS2015+ |
33-
| 7.0 - 7.3 | v1.1.0-beta or higher | VS2017 |
32+
| 1.0 - 6.0 | v1.0.2 or higher | VS2015+ |
33+
| 7.0 - 7.3 | v1.1.0-beta or higher | VS2017+ |
34+
| 8.0 | v1.2.0-beta or higher | VS2019 |
3435

3536
## Installation
3637

StyleCop.Analyzers/Directory.Build.props

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
</PropertyGroup>
2121

2222
<PropertyGroup>
23-
<DebugType>portable</DebugType>
23+
<DebugType Condition="'$(Configuration)' == 'Debug'">full</DebugType>
24+
<DebugType Condition="'$(Configuration)' != 'Debug'">portable</DebugType>
2425
<DebugSymbols>true</DebugSymbols>
2526
</PropertyGroup>
2627

@@ -44,10 +45,20 @@
4445
<ItemGroup>
4546
<PackageReference Include="AsyncUsageAnalyzers" Version="1.0.0-alpha003" PrivateAssets="all" />
4647
<PackageReference Include="DotNetAnalyzers.DocumentationAnalyzers" Version="1.0.0-beta.46" PrivateAssets="all" />
47-
<PackageReference Include="StyleCop.Analyzers" Version="1.1.1-rc.114" PrivateAssets="all" />
48+
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.66" PrivateAssets="all" />
4849
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeStyle" Version="2.11.0-beta2-63603-03" PrivateAssets="all" />
4950
</ItemGroup>
5051

52+
<!-- Public API -->
53+
<ItemGroup>
54+
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="2.9.7" PrivateAssets="all" />
55+
</ItemGroup>
56+
57+
<ItemGroup>
58+
<AdditionalFiles Include="PublicAPI.Shipped.txt" Condition="Exists('PublicAPI.Shipped.txt')" />
59+
<AdditionalFiles Include="PublicAPI.Unshipped.txt" Condition="Exists('PublicAPI.Unshipped.txt')" />
60+
</ItemGroup>
61+
5162
<ItemGroup>
5263
<None Include="$(MSBuildThisFileDirectory)*.ruleset" Link="%(Filename)%(Extension)" />
5364

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace StyleCop.Analyzers.DocumentationRules
2121
/// </summary>
2222
[ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(PropertySummaryDocumentationCodeFixProvider))]
2323
[Shared]
24-
public class PropertySummaryDocumentationCodeFixProvider : CodeFixProvider
24+
internal class PropertySummaryDocumentationCodeFixProvider : CodeFixProvider
2525
{
2626
/// <inheritdoc/>
2727
public override ImmutableArray<string> FixableDiagnosticIds { get; } =

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/DocumentationRules/SA1629CodeFixProvider.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ public override Task RegisterCodeFixesAsync(CodeFixContext context)
5252
private static async Task<Document> GetTransformedDocumentAsync(Document document, Diagnostic diagnostic, CancellationToken cancellationToken)
5353
{
5454
var text = await document.GetTextAsync(cancellationToken).ConfigureAwait(false);
55-
var newText = text.WithChanges(new TextChange(new TextSpan(diagnostic.Location.SourceSpan.Start, 0), "."));
55+
bool replaceChar = diagnostic.Properties.ContainsKey(SA1629DocumentationTextMustEndWithAPeriod.ReplaceCharKey);
56+
var newText = text.WithChanges(new TextChange(new TextSpan(diagnostic.Location.SourceSpan.Start, replaceChar ? 1 : 0), "."));
5657

5758
return document.WithText(newText);
5859
}

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/MaintainabilityRules/SA1119CodeFixProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private static SyntaxNode GetReplacement(ParenthesizedExpressionSyntax oldNode)
7474
if (!leadingTrivia.Any())
7575
{
7676
var previousToken = oldNode.OpenParenToken.GetPreviousToken();
77-
if (TriviaHelper.IndexOfTrailingWhitespace(previousToken.TrailingTrivia) == -1)
77+
if (!previousToken.IsKind(SyntaxKind.OpenParenToken) && (TriviaHelper.IndexOfTrailingWhitespace(previousToken.TrailingTrivia) == -1))
7878
{
7979
leadingTrivia = SyntaxFactory.TriviaList(SyntaxFactory.Space);
8080
}

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/PublicAPI.Shipped.txt

Whitespace-only changes.

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/PublicAPI.Unshipped.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)