Enable CA1067
: Override Object.Equals(object)
when implementing IEquatable<T>
(#13871)
* Enable CA1067: Override Object.Equals(object) when implementing IEquatable<T> * Group Equals methods * Reformat xml documentation * Update src/System.Management.Automation/engine/EventManager.cs Co-authored-by: Joel Sallow (/u/ta11ow) <32407840+vexx32@users.noreply.github.com> Co-authored-by: Joel Sallow (/u/ta11ow) <32407840+vexx32@users.noreply.github.com>
This commit is contained in:
parent
44595a40ec
commit
01a4714b76
|
@ -198,8 +198,8 @@ dotnet_diagnostic.CA1065.severity = warning
|
|||
dotnet_diagnostic.CA1066.severity = none
|
||||
|
||||
# CA1067: Override Object.Equals(object) when implementing IEquatable<T>
|
||||
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1067
|
||||
dotnet_diagnostic.CA1067.severity = suggestion
|
||||
# # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1067
|
||||
dotnet_diagnostic.CA1067.severity = warning
|
||||
|
||||
# CA1068: CancellationToken parameters must come last
|
||||
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1068
|
||||
|
|
|
@ -2042,6 +2042,19 @@ namespace System.Management.Automation
|
|||
|
||||
#region IComparable<PSEventSubscriber> Members
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified object is equal to the current object.
|
||||
/// </summary>
|
||||
/// <param name="obj">The object to compare with the current object.</param>
|
||||
/// <returns>
|
||||
/// <see langword="true"/> if the specified object is equal to the current object;
|
||||
/// otherwise, <see langword="false"/>.
|
||||
/// </returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
return obj is PSEventSubscriber es && Equals(es);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines if two PSEventSubscriber instances are equal
|
||||
/// <param name="other">
|
||||
|
|
Loading…
Reference in a new issue