Skip to content

Commit

Permalink
CA1018: Mark attributes with AttributeUsageAttribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Evangelink committed Jul 19, 2022
1 parent 2ddf593 commit 3d2bb6e
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ dotnet_diagnostic.CA1822.severity = warning # not default, increased severity to
# CA1816: Dispose methods should call SuppressFinalize
dotnet_diagnostic.CA1816.severity = warning # not default, increased severity to ensure it is applied

# CA1018: Mark attributes with AttributeUsageAttribute
dotnet_diagnostic.CA1018.severity = warning # not default, increased severity to ensure it is applied

#### C# Coding Conventions ####

# var preferences
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
namespace Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.ObjectModel;

[Conditional("DEBUG")]
[AttributeUsage(AttributeTargets.Field)]
internal class ProtocolVersionAttribute : Attribute
{
public ProtocolVersionAttribute(int added, Type payloadType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace Microsoft.VisualStudio.TestPlatform;
/// <summary>
/// Only to be used to Test platform, to exclude auto generated code from CodeCoverage
/// </summary>
[AttributeUsage(AttributeTargets.All)]
public class TestSDKAutoGeneratedCode : Attribute
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection;
/// <summary>
/// Registers an attachment processor for a data collector.
/// </summary>
[AttributeUsage(AttributeTargets.Class)]
public class DataCollectorAttachmentProcessorAttribute : Attribute
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection;
/// <summary>
/// Provides a friendly name for the data collector.
/// </summary>
[AttributeUsage(AttributeTargets.Class)]
public class DataCollectorFriendlyNameAttribute : Attribute
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection;
/// Provides unique identification of a data collector in the form of a URI.
/// Recommended format: 'datacollector://Company/Product/Version'
/// </summary>
[AttributeUsage(AttributeTargets.Class)]
public class DataCollectorTypeUriAttribute : Attribute
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
namespace Microsoft.TestPlatform.PlatformAbstractions;

[Conditional("DEBUG")]
[AttributeUsage(AttributeTargets.Method)]
internal class VersionAttribute : Attribute
{
public string? Description { get; set; }
Expand Down

0 comments on commit 3d2bb6e

Please sign in to comment.