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

CA1018: Mark attributes with AttributeUsageAttribute #3865

Merged
merged 1 commit into from
Jul 19, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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