Nall.Generator.Equals.Analyzers 1.0.4

dotnet add package Nall.Generator.Equals.Analyzers --version 1.0.4
                    
NuGet\Install-Package Nall.Generator.Equals.Analyzers -Version 1.0.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Nall.Generator.Equals.Analyzers" Version="1.0.4">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nall.Generator.Equals.Analyzers" Version="1.0.4" />
                    
Directory.Packages.props
<PackageReference Include="Nall.Generator.Equals.Analyzers">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Nall.Generator.Equals.Analyzers --version 1.0.4
                    
#r "nuget: Nall.Generator.Equals.Analyzers, 1.0.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Nall.Generator.Equals.Analyzers@1.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Nall.Generator.Equals.Analyzers&version=1.0.4
                    
Install as a Cake Addin
#tool nuget:?package=Nall.Generator.Equals.Analyzers&version=1.0.4
                    
Install as a Cake Tool

Nall.Generator.Equals.Analyzers

A Roslyn analyzer for the Generator.Equals library that ensures proper equality attribute usage on collection properties.

Features

  • Smart Diagnostics: Detects collection properties in [Equatable] classes that lack required equality attributes
  • Intelligent Code Fixes: Provides collection-specific attribute suggestions:
    • Dictionary<TKey,TValue>[DictionaryEquality]
    • HashSet<T> / ISet<T>[SetEquality]
    • List<T> / Array / IEnumerable<T>[OrderedEquality] or [UnorderedEquality]

Example Usage

Before (Triggers GE001 Warning)

[Equatable]
public partial class MyClass
{
    public List<string> Items { get; set; } // ⚠️ GE001: Missing equality attribute
    public Dictionary<string, int> Data { get; set; } // ⚠️ GE001: Missing equality attribute
}

After (With Code Fixes Applied)

[Equatable]

public partial class MyClass
{
    [UnorderedEquality] // or [OrderedEquality]
    public List<string> Items { get; set; }

    [DictionaryEquality]
    public Dictionary<string, int> Data { get; set; }
}

Example of code fix suggestions: alternate text is missing from this package README image

Installation

dotnet add package Nall.GeneratorEquals.Analyzers
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.4 391 9/17/2025

# Release Notes

## Version 1.0.4 - 2025-09-17

### 🔧 Bug Fixes
- **Removed Dictionary and HashSet support** - These collection types are not actually supported by the Generator.Equals library
- **Removed DictionaryEquality and SetEquality attributes** - These attributes don't exist in the Generator.Equals library

### ✅ Supported Collection Types
- **Arrays**: `T[]`
- **Lists**: `List<T>`, `IList<T>`, `ICollection<T>`, `IEnumerable<T>`
- **Collections**: `Collection<T>`, `ObservableCollection<T>`

### ✅ Supported Equality Attributes
- `IgnoreEquality`, `DefaultEquality`, `SequenceEquality`
- `ReferenceEquality`, `OrderedEquality`, `UnorderedEquality`

---

## Version 1.0.3 - 2025-09-17

### 🎉 Initial Release
- **GE001 Diagnostic**: Detects collection properties in `[Equatable]` classes missing equality attributes
- **Basic Code Fix Provider**: Provides code fixes to add equality attributes