Skip to content

Commit

Permalink
Enable MA0057 and fix noncompliance
Browse files Browse the repository at this point in the history
"Class name should end with 'Attribute'" (when subclassing `Attribute`)
  • Loading branch information
YoshiRulz committed Jul 3, 2024
1 parent 3fb0afa commit 152b3ad
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .global.editorconfig.ini
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ dotnet_diagnostic.MA0055.severity = silent
# Do not call overridable members in constructor
dotnet_diagnostic.MA0056.severity = silent
# Class name should end with 'Attribute'
dotnet_diagnostic.MA0057.severity = silent
dotnet_diagnostic.MA0057.severity = error
# Class name should end with 'Exception'
dotnet_diagnostic.MA0058.severity = error
# Class name should end with 'EventArgs'
Expand Down
2 changes: 2 additions & 0 deletions src/BizHawk.Client.Common/Api/ExternalToolAttributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

namespace BizHawk.Client.Common
{
#pragma warning disable MA0057 // oops, should have called these `*Attribute`, too late now --yoshi
public static class ExternalToolApplicability
{
/// <remarks>This class is not deprecated, do not remove it.</remarks>
Expand Down Expand Up @@ -100,6 +101,7 @@ public abstract class ExternalToolApplicabilityAttributeBase : Attribute

public class DuplicateException : Exception {}
}
#pragma warning disable MA0057

[AttributeUsage(AttributeTargets.Class)]
public sealed class ExternalToolAttribute : Attribute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ public interface ISettable<TSettings, TSync> : IEmulatorService
/// Classes with this attribute will have a BizHawk.Common.SettingsUtil.SetDefaultValues(T) function generated
/// </summary>
[AttributeUsage(AttributeTargets.Class)]
public class CoreSettings : Attribute
{
}
public class CoreSettingsAttribute : Attribute {}

//note: this is a bit of a frail API. If a frontend wants a new flag, cores won't know to yea or nay it
//this could be solved by adding a KnownSettingsDirtyBits on the settings interface
Expand Down

0 comments on commit 152b3ad

Please sign in to comment.