Roslyn analyzer that ensures proper equality attribute usage on collection properties in Generator.Equals classes. Supports arrays, lists, and collections with intelligent code fixes for IgnoreEquality, DefaultEquality, SequenceEquality, ReferenceEquality, OrderedEquality, and UnorderedEquality attributes.
$ dotnet add package Nall.Generator.Equals.AnalyzersA Roslyn analyzer for the Generator.Equals library that ensures proper equality attribute usage on collection properties.
dotnet add package Nall.Generator.Equals.Analyzers
[Equatable] classes that lack required equality attributes[Equatable] classes where the property type lacks [Equatable] attribute[Equatable] attribute on the element typeList<T> / Array / IEnumerable<T> → [OrderedEquality] or [UnorderedEquality]// Before
[Equatable]
public partial class MyClass
{
public List<string> Items { get; set; } // ⚠️ GE001: Missing equality attribute
}
// After
[Equatable]
public partial class MyClass
{
[UnorderedEquality] // or [OrderedEquality]
public List<string> Items { get; set; }
}
// Before
[Equatable]
public partial class Person
{
public Address HomeAddress { get; set; } // ⚠️ GE002: Type 'Address' needs [Equatable]
}
public class Address { /* ... */ }
// After
[Equatable]
public partial class Person
{
public Address HomeAddress { get; set; } // ✅ No warning
}
[Equatable]
public partial class Address { /* ... */ }
// Before
[Equatable]
public partial class CustomerList
{
[OrderedEquality]
public List<Customer> Customers { get; set; } // ⚠️ GE003: Element type 'Customer' needs [Equatable]
}
public class Customer { /* ... */ }
// After
[Equatable]
public partial class CustomerList
{
[OrderedEquality]
public List<Customer> Customers { get; set; } // ✅ No warning
}
[Equatable]
public partial class Customer { /* ... */ }
Example of code fix suggestions:

This project is licensed under the MIT License - see the LICENSE file for details.