Skip to content

Commit ca4cc3d

Browse files
committed
Convert public types to internal
Fixes #1502
1 parent 7847d19 commit ca4cc3d

250 files changed

Lines changed: 290 additions & 246 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.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
2+
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
3+
4+
namespace StyleCop.Analyzers.Test
5+
{
6+
using System;
7+
using System.Text;
8+
using Xunit;
9+
10+
/// <summary>
11+
/// Unit tests related to the public API surface of StyleCop.Analyzers.dll.
12+
/// </summary>
13+
public class PublicApiTests
14+
{
15+
/// <summary>
16+
/// This test ensures all types in StyleCop.Analyzers.dll are marked internal.
17+
/// </summary>
18+
[Fact]
19+
public void TestAllTypesAreInternal()
20+
{
21+
StringBuilder publicTypes = new StringBuilder();
22+
foreach (Type type in typeof(AnalyzerCategory).Assembly.ExportedTypes)
23+
{
24+
if (publicTypes.Length > 0)
25+
{
26+
publicTypes.Append(", ");
27+
}
28+
29+
publicTypes.Append(type.Name);
30+
}
31+
32+
Assert.Equal(string.Empty, publicTypes.ToString());
33+
}
34+
}
35+
}

StyleCop.Analyzers/StyleCop.Analyzers.Test/StyleCop.Analyzers.Test.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@
274274
<Compile Include="OrderingRules\SA1217UnitTests.cs" />
275275
<Compile Include="OrderingRules\UsingCodeFixProviderUnitTests.cs" />
276276
<Compile Include="Properties\AssemblyInfo.cs" />
277+
<Compile Include="PublicApiTests.cs" />
277278
<Compile Include="ReadabilityRules\SA1100UnitTests.cs" />
278279
<Compile Include="ReadabilityRules\SA1101UnitTests.cs" />
279280
<Compile Include="ReadabilityRules\SA1102UnitTests.cs" />

StyleCop.Analyzers/StyleCop.Analyzers/AnalyzerExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace StyleCop.Analyzers
1313
/// <summary>
1414
/// Provides extension methods to deal for analyzers.
1515
/// </summary>
16-
public static class AnalyzerExtensions
16+
internal static class AnalyzerExtensions
1717
{
1818
/// <summary>
1919
/// A cache of the result of computing whether a document has an auto-generated header.

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/ElementDocumentationSummaryBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace StyleCop.Analyzers.DocumentationRules
1313
/// <summary>
1414
/// This is the base class for analyzers which examine the <c>&lt;summary&gt;</c> text of a documentation comment.
1515
/// </summary>
16-
public abstract class ElementDocumentationSummaryBase : DiagnosticAnalyzer
16+
internal abstract class ElementDocumentationSummaryBase : DiagnosticAnalyzer
1717
{
1818
/// <inheritdoc/>
1919
public override void Initialize(AnalysisContext context)

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/FileHeaderAnalyzers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace StyleCop.Analyzers.DocumentationRules
2626
/// <seealso href="https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1641.md">SA1641 File header company name text must match</seealso>
2727
/// <seealso href="https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1649.md">SA1649 File header file name documentation must match type name</seealso>
2828
[DiagnosticAnalyzer(LanguageNames.CSharp)]
29-
public class FileHeaderAnalyzers : DiagnosticAnalyzer
29+
internal class FileHeaderAnalyzers : DiagnosticAnalyzer
3030
{
3131
private const string SA1633Identifier = "SA1633";
3232
private const string SA1634Identifier = "SA1634";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace StyleCop.Analyzers.DocumentationRules
2424
/// </remarks>
2525
[ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(FileHeaderCodeFixProvider))]
2626
[Shared]
27-
public class FileHeaderCodeFixProvider : CodeFixProvider
27+
internal class FileHeaderCodeFixProvider : CodeFixProvider
2828
{
2929
/// <inheritdoc/>
3030
public override ImmutableArray<string> FixableDiagnosticIds { get; }

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

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

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/PartialElementDocumentationSummaryBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace StyleCop.Analyzers.DocumentationRules
1414
/// This is the base class for analyzers which examine the <c>&lt;summary&gt;</c> or <c>&lt;content&gt;</c> text of
1515
/// the documentation comment associated with a <c>partial</c> element.
1616
/// </summary>
17-
public abstract class PartialElementDocumentationSummaryBase : DiagnosticAnalyzer
17+
internal abstract class PartialElementDocumentationSummaryBase : DiagnosticAnalyzer
1818
{
1919
/// <inheritdoc/>
2020
public override void Initialize(AnalysisContext context)

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/PropertyDocumentationSummaryBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace StyleCop.Analyzers.DocumentationRules
1212
/// <summary>
1313
/// This is the base class for analyzers which examine the <c>&lt;value&gt;</c> text of a documentation comment on a property declaration.
1414
/// </summary>
15-
public abstract class PropertyDocumentationSummaryBase : DiagnosticAnalyzer
15+
internal abstract class PropertyDocumentationSummaryBase : DiagnosticAnalyzer
1616
{
1717
/// <inheritdoc/>
1818
public override void Initialize(AnalysisContext context)

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/SA1600ElementsMustBeDocumented.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace StyleCop.Analyzers.DocumentationRules
2626
/// delegates, enums, events, finalizers, indexers, interfaces, methods, properties, and structs.</para>
2727
/// </remarks>
2828
[DiagnosticAnalyzer(LanguageNames.CSharp)]
29-
public class SA1600ElementsMustBeDocumented : DiagnosticAnalyzer
29+
internal class SA1600ElementsMustBeDocumented : DiagnosticAnalyzer
3030
{
3131
/// <summary>
3232
/// The ID for diagnostics produced by the <see cref="SA1600ElementsMustBeDocumented"/> analyzer.

0 commit comments

Comments
 (0)