ArchUnitNET icon indicating copy to clipboard operation
ArchUnitNET copied to clipboard

DoNotDependOnAny() does verify inheritance

Open Floopy-Doo opened this issue 2 months ago • 2 comments

With the update to version 0.13 we run into a problem that DoNotDependOnAny no longer checks on the inheritance of a class.

Our Test:

Classes()
    .That()
    .AreNotAbstract()
    .And()
    .DoNotHaveAnyAttributes(typeof(CompilerGeneratedAttribute)) // Excludes all blazor components
    .And()
    .DoNotDependOnAny(typeof(ComponentBase))
    .And()
    .DoNotHaveName(nameof(_Imports)) // Excludes all _Imports of blazor
    .Should()
    .BeSealed()
    .Check(OurArchitecture)

All classes inherit from component base are with the update no longer excluded from the test.

I did not see anything in the change notes that would indicate.

Floopy-Doo avatar Dec 11 '25 08:12 Floopy-Doo

Hi @Floopy-Doo, would you be able to provide a small example project that demonstrates the issue?

alexanderlinne avatar Dec 11 '25 12:12 alexanderlinne