Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a new test project for c# 11 #3491

Merged
merged 5 commits into from May 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion StyleCop.Analyzers/Directory.Build.props
Expand Up @@ -47,7 +47,7 @@
<PackageReference Include="AsyncUsageAnalyzers" Version="1.0.0-alpha003" PrivateAssets="all" />
<PackageReference Include="DotNetAnalyzers.DocumentationAnalyzers" Version="1.0.0-beta.46" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.304" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.2" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeStyle" Version="4.0.1" PrivateAssets="all" />
</ItemGroup>

Expand Down
Expand Up @@ -449,12 +449,12 @@ private static SyntaxTriviaList RemoveHeaderDecorationLines(SyntaxTriviaList tri
for (int i = 0; i < trivia.Count; i++)
{
var triviaLine = trivia[i];
if (triviaLine.Kind() == SyntaxKind.SingleLineCommentTrivia && triviaLine.ToFullString().Contains(settings.DocumentationRules.HeaderDecoration))
if (triviaLine.IsKind(SyntaxKind.SingleLineCommentTrivia) && triviaLine.ToFullString().Contains(settings.DocumentationRules.HeaderDecoration))
{
decorationRemovalList.Add(i);

// also remove the line break
if (i + 1 < trivia.Count && trivia[i + 1].Kind() == SyntaxKind.EndOfLineTrivia)
if (i + 1 < trivia.Count && trivia[i + 1].IsKind(SyntaxKind.EndOfLineTrivia))
{
decorationRemovalList.Add(i + 1);
}
Expand Down
Expand Up @@ -19,4 +19,5 @@
[assembly: InternalsVisibleTo("StyleCop.Analyzers.Test.CSharp8, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c36d40d996fcc95fb6a89754728616758f459026e31478ce93633b3e27a4af416f103aa3d7a9e7998f829f8715cc1240d30724fd662042550fa71357b19562622424267e9e4640c403edbe64709a9ca5918128a9b9020b0db6e770d0dd1eac888869c23a835b74bde00e171984b1d1c24636cf030f0b23106e73035a2be145a6")]
[assembly: InternalsVisibleTo("StyleCop.Analyzers.Test.CSharp9, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c36d40d996fcc95fb6a89754728616758f459026e31478ce93633b3e27a4af416f103aa3d7a9e7998f829f8715cc1240d30724fd662042550fa71357b19562622424267e9e4640c403edbe64709a9ca5918128a9b9020b0db6e770d0dd1eac888869c23a835b74bde00e171984b1d1c24636cf030f0b23106e73035a2be145a6")]
[assembly: InternalsVisibleTo("StyleCop.Analyzers.Test.CSharp10, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c36d40d996fcc95fb6a89754728616758f459026e31478ce93633b3e27a4af416f103aa3d7a9e7998f829f8715cc1240d30724fd662042550fa71357b19562622424267e9e4640c403edbe64709a9ca5918128a9b9020b0db6e770d0dd1eac888869c23a835b74bde00e171984b1d1c24636cf030f0b23106e73035a2be145a6")]
[assembly: InternalsVisibleTo("StyleCop.Analyzers.Test.CSharp11, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c36d40d996fcc95fb6a89754728616758f459026e31478ce93633b3e27a4af416f103aa3d7a9e7998f829f8715cc1240d30724fd662042550fa71357b19562622424267e9e4640c403edbe64709a9ca5918128a9b9020b0db6e770d0dd1eac888869c23a835b74bde00e171984b1d1c24636cf030f0b23106e73035a2be145a6")]
[assembly: InternalsVisibleTo("StyleCopTester, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c36d40d996fcc95fb6a89754728616758f459026e31478ce93633b3e27a4af416f103aa3d7a9e7998f829f8715cc1240d30724fd662042550fa71357b19562622424267e9e4640c403edbe64709a9ca5918128a9b9020b0db6e770d0dd1eac888869c23a835b74bde00e171984b1d1c24636cf030f0b23106e73035a2be145a6")]
@@ -0,0 +1,13 @@
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.CSharp11
{
using StyleCop.Analyzers.Test.CSharp10;

public class AnalyzerConfigurationTestsCSharp11 : AnalyzerConfigurationTestsCSharp10
{
}
}
@@ -0,0 +1,13 @@
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
{
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;

public class CSharp11InheritdocCodeFixProviderUnitTests : CSharp10InheritdocCodeFixProviderUnitTests
{
}
}
@@ -0,0 +1,13 @@
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
{
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;

public class CSharp11NoXmlFileHeaderUnitTests : CSharp10NoXmlFileHeaderUnitTests
{
}
}
@@ -0,0 +1,13 @@
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
{
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;

public class SA1600CSharp11UnitTests : SA1600CSharp10UnitTests
{
}
}
@@ -0,0 +1,13 @@
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
{
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;

public class SA1601CSharp11UnitTests : SA1601CSharp10UnitTests
{
}
}
@@ -0,0 +1,13 @@
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
{
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;

public class SA1602CSharp11UnitTests : SA1602CSharp10UnitTests
{
}
}
@@ -0,0 +1,13 @@
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
{
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;

public class SA1603CSharp11UnitTests : SA1603CSharp10UnitTests
{
}
}
@@ -0,0 +1,13 @@
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
{
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;

public class SA1604CSharp11UnitTests : SA1604CSharp10UnitTests
{
}
}
@@ -0,0 +1,13 @@
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
{
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;

public class SA1605CSharp11UnitTests : SA1605CSharp10UnitTests
{
}
}
@@ -0,0 +1,13 @@
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
{
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;

public class SA1606CSharp11UnitTests : SA1606CSharp10UnitTests
{
}
}
@@ -0,0 +1,13 @@
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
{
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;

public class SA1607CSharp11UnitTests : SA1607CSharp10UnitTests
{
}
}
@@ -0,0 +1,13 @@
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
{
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;

public class SA1608CSharp11UnitTests : SA1608CSharp10UnitTests
{
}
}
@@ -0,0 +1,13 @@
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
{
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;

public class SA1609CSharp11UnitTests : SA1609CSharp10UnitTests
{
}
}
@@ -0,0 +1,13 @@
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
{
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;

public class SA1610CSharp11UnitTests : SA1610CSharp10UnitTests
{
}
}
@@ -0,0 +1,13 @@
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
{
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;

public class SA1611CSharp11UnitTests : SA1611CSharp10UnitTests
{
}
}
@@ -0,0 +1,13 @@
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
{
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;

public class SA1612CSharp11UnitTests : SA1612CSharp10UnitTests
{
}
}
@@ -0,0 +1,13 @@
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
{
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;

public class SA1613CSharp11UnitTests : SA1613CSharp10UnitTests
{
}
}
@@ -0,0 +1,13 @@
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
{
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;

public class SA1614CSharp11UnitTests : SA1614CSharp10UnitTests
{
}
}
@@ -0,0 +1,13 @@
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
{
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;

public class SA1615CSharp11UnitTests : SA1615CSharp10UnitTests
{
}
}
@@ -0,0 +1,13 @@
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
{
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;

public class SA1616CSharp11UnitTests : SA1616CSharp10UnitTests
{
}
}
@@ -0,0 +1,13 @@
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
{
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;

public class SA1617CSharp11UnitTests : SA1617CSharp10UnitTests
{
}
}
@@ -0,0 +1,13 @@
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
{
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;

public class SA1618CSharp11UnitTests : SA1618CSharp10UnitTests
{
}
}
@@ -0,0 +1,13 @@
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
{
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;

public class SA1619CSharp11UnitTests : SA1619CSharp10UnitTests
{
}
}
@@ -0,0 +1,13 @@
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
{
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;

public class SA1620CSharp11UnitTests : SA1620CSharp10UnitTests
{
}
}
@@ -0,0 +1,13 @@
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
{
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;

public class SA1621CSharp11UnitTests : SA1621CSharp10UnitTests
{
}
}
@@ -0,0 +1,13 @@
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.CSharp11.DocumentationRules
{
using StyleCop.Analyzers.Test.CSharp10.DocumentationRules;

public class SA1622CSharp11UnitTests : SA1622CSharp10UnitTests
{
}
}