Skip to content

Conversation

@smaillet
Copy link
Member

Added analyzer support with initial basic analysis and testing.

  • Renamed EnumerableObjectComparer => SequenceComparer and added generic type param for items.

  • Re-worked standard test support for generators to better match patterns/style of analyzer tests.

    • Removed need for Basic assembly package
    • Added CachedSourceGeneratorTest<TGenerator, TVerifier> to handle common cached validation.
  • Added location retrieval extension for AttributeData to allow getting the location of the attribute itself for reporting diagnostic associated with the attribute.

  • Reduced language runtime minimums to C# 12/.NET 8.0

  • Renamed SourceGeneratorTest<TSourceGenerator, TVerifier> as LanguageVerionsSourceGeneratorTest<TSourceGenerator, TVerifier>

    • The new name better describes use, it is intended as a base class for some other type, particularly the new
      CachedSourceGeneratorTest<TGenerator, TVerifier>
  • Added extensions for C# LanguageVersion to get default runtime assemblies and nullability behavior etc.. based on language version.

  • Converted all test extensions to use IVerifier

    • This makes the Ubiquity.NET.SourceGenerator.Test.Utils independent of the actual test framework so it should be more useful
    • Add MsTestVerifier to the UT itself so that there is an adapter that interacts with the MS Test framework of those libraries.
      • The DefaultVerifier implementation cheats and uses an InvalidOperationException for all cases and doesn't actually adapt to anything.
  • Removed support for VB

    • Inclusion of VB support or any other language causes problems with RS1038
    • If per language support is really desired then the language specific support needs isolation to distinct libraries.
  • Added AttributeDataExtensions.GetLocation() to get the location of an attribute.

  • Renamed x64.runsettings to simply .runsettings

    • Apparently something changed in the IDE and it now requires that name.

* Renamed `EnumerableObjectComparer` => `SequenceComparer` and added generic type param for items.
* Re-worked standard test support for generators to better match patterns/style of analyzer tests.
    - Removed need for Basic assembly package
    - Added `CachedSourceGeneratorTest<TGenerator, TVerifier>` to handle common cached validation.
* Added location retrieval extension for `AttributeData` to allow getting the location of the attribute itself for reporting diagnostic associated with the attribute.
* Reduced language runtime minimums to C# 12/.NET 8.0
* Renamed `SourceGeneratorTest<TSourceGenerator, TVerifier>` as `LanguageVerionsSourceGeneratorTest<TSourceGenerator, TVerifier>`
    - The new name better describes use, it is intended as a base class for some other type, particularly the new
`CachedSourceGeneratorTest<TGenerator, TVerifier>`
* Added extensions for C# `LanguageVersion` to get default runtime assemblies and nullability behavior etc.. based on language version.
* Converted all test extensions to use `IVerifier`
    - This makes the `Ubiquity.NET.SourceGenerator.Test.Utils` independent of the actual test framework so it should be more useful
    - Add MsTestVerifier to the UT itself so that there is an adapter that interacts with the MS Test framework of those libraries.
        - The `DefaultVerifier` implementation cheats and uses an `InvalidOperationException` for all cases and doesn't actually adapt to anything.

* Removed support for VB
   - Inclusion of VB support or any other language causes problems with [RS1038](https://github.com/dotnet/roslyn/blob/main/docs/roslyn-analyzers/rules/RS1038.md)
   - If per language support is really desired then the language specific support needs isolation to distinct libraries.
* Added `AttributeDataExtensions.GetLocation()` to get the location of an attribute.
* Renamed `x64.runsettings` to simply `.runsettings`
    - Apparently something changed in the IDE and it now requires that name.
@smaillet smaillet changed the title Added analyzer support with initial basic analysis and testing. Added analyzer support for command line library with initial basic analysis and testing. Jan 15, 2026
@github-actions
Copy link

Test Results

  8 files  ± 0    8 suites  ±0   1m 10s ⏱️ + 1m 4s
169 tests +11  165 ✅ +11  4 💤 ±0  0 ❌ ±0 
300 runs  +11  291 ✅ +11  9 💤 ±0  0 ❌ ±0 

Results for commit a630867. ± Comparison against base commit 0243ab3.

This pull request removes 1 and adds 12 tests. Note that renamed tests count towards both.
Ubiquity.NET.CommandLine.SrcGen.UT.RootCommandAttributeTests ‑ Basic_golden_path_succeeds
Ubiquity.NET.CommandLine.SrcGen.UT.CommandAnalyzerTests ‑ Empty_source_analyzes_clean (Net10_0)
Ubiquity.NET.CommandLine.SrcGen.UT.CommandAnalyzerTests ‑ Empty_source_analyzes_clean (Net8_0)
Ubiquity.NET.CommandLine.SrcGen.UT.CommandAnalyzerTests ‑ FileValidation_attribute_without_command_triggers_diagnostic (Net10_0)
Ubiquity.NET.CommandLine.SrcGen.UT.CommandAnalyzerTests ‑ FileValidation_attribute_without_command_triggers_diagnostic (Net8_0)
Ubiquity.NET.CommandLine.SrcGen.UT.CommandAnalyzerTests ‑ FolderValidation_attribute_without_command_triggers_diagnostic (Net10_0)
Ubiquity.NET.CommandLine.SrcGen.UT.CommandAnalyzerTests ‑ FolderValidation_attribute_without_command_triggers_diagnostic (Net8_0)
Ubiquity.NET.CommandLine.SrcGen.UT.CommandAnalyzerTests ‑ GoldenPath_produces_no_diagnostics (Net10_0)
Ubiquity.NET.CommandLine.SrcGen.UT.CommandAnalyzerTests ‑ GoldenPath_produces_no_diagnostics (Net8_0)
Ubiquity.NET.CommandLine.SrcGen.UT.CommandAnalyzerTests ‑ Option_attribute_without_command_triggers_diagnostic (Net10_0)
Ubiquity.NET.CommandLine.SrcGen.UT.CommandAnalyzerTests ‑ Option_attribute_without_command_triggers_diagnostic (Net8_0)
…

@smaillet smaillet merged commit 90aebad into UbiquityDotNET:develop Jan 15, 2026
3 checks passed
@smaillet smaillet deleted the AddAnalyzer branch January 15, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant