Skip to content

fix: stop AWT151 for a module that only imports services - #228

Merged
vbreuss merged 1 commit into
fix/awt179-specialisationfrom
fix/awt151-import-service
Oct 30, 2026
Merged

vbreuss merged 1 commit into
fix/awt179-specialisationfrom
fix/awt151-import-service

Conversation

@vbreuss

@vbreuss vbreuss commented Oct 30, 2026

Copy link
Copy Markdown
Member

Modules honour [ImportService] and [ImportService(typeof(...))] like [ImportServices], but AWT151 did not count them, so a module whose whole contribution is an imported service was reported as empty. Following the warning and removing the import would turn the dependency into AWT101.

The check now counts ImportServiceAttribute (covering the generic and the typeof form) and is renamed from DeclaresAnyRegistration to DeclaresAnyContribution, since it now counts imports as well as registrations.

Modules honour [ImportService<T>] and [ImportService(typeof(...))] like [ImportServices], but AWT151 did not count them, so a module whose whole contribution is an imported service was reported as empty. Following the warning and removing the import would turn the dependency into AWT101.

The check now counts ImportServiceAttribute (covering the generic and the typeof form) and is renamed from DeclaresAnyRegistration to DeclaresAnyContribution, since it now counts imports as well as registrations.
@vbreuss vbreuss self-assigned this Oct 30, 2026
@vbreuss
vbreuss added this pull request to stack #227 October 30, 2026 16:51
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Test Results

   27 files  ± 0     27 suites  ±0   1h 13m 0s ⏱️ - 4m 41s
1 690 tests + 5  1 690 ✅ + 5  0 💤 ±0  0 ❌ ±0 
8 185 runs  +15  8 185 ✅ +15  0 💤 ±0  0 ❌ ±0 

Results for commit eef1f58. ± Comparison against base commit 0b0845e.

♻️ This comment has been updated with latest results.

@vbreuss
vbreuss merged commit 2cd4104 into main Oct 30, 2026
27 checks passed
@vbreuss
vbreuss deleted the fix/awt151-import-service branch October 30, 2026 17:00
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

🚀 Benchmark Results

Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 26.04.1 LTS (Resolute Raccoon)
AMD EPYC 7763 3.00GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.303
[Host] : .NET 10.0.14 (10.0.14, 10.0.1426.52326), X64 RyuJIT x86-64-v3

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Realistic Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 305.4 ns 1.00 ns 0.89 ns 1.01 568 B 1.00
Awaiten 301.9 ns 2.55 ns 2.38 ns 1.00 568 B 1.00
MsDI 632.9 ns 8.82 ns 7.82 ns 2.10 1104 B 1.94
Autofac 6,677.7 ns 89.28 ns 83.51 ns 22.12 10784 B 18.99
Jab 178.4 ns 2.00 ns 1.87 ns 0.59 432 B 0.76
DryIoc 407.2 ns 4.29 ns 4.01 ns 1.35 944 B 1.66
SimpleInjector 739.0 ns 6.60 ns 6.17 ns 2.45 1096 B 1.93
PureDI 177.9 ns 2.44 ns 2.17 ns 0.59 632 B 1.11
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 26.04.1 LTS (Resolute Raccoon)
AMD EPYC 9V45 4.24GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.303
[Host] : .NET 10.0.14 (10.0.14, 10.0.1426.52326), X64 RyuJIT x86-64-v4

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Resolve Size Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 8 7.050 ns 0.0091 ns 0.0071 ns 1.60 - NA
Awaiten 8 4.409 ns 0.1581 ns 0.1402 ns 1.00 - NA
MsDI 8 4.095 ns 0.0380 ns 0.0318 ns 0.93 - NA
Autofac 8 59.805 ns 0.8715 ns 0.7277 ns 13.58 656 B NA
Jab 8 1.486 ns 0.0675 ns 0.0631 ns 0.34 - NA
PureDI 8 3.004 ns 0.1151 ns 0.1020 ns 0.68 - NA
DryIoc 8 5.073 ns 0.2265 ns 0.2008 ns 1.15 - NA
SimpleInjector 8 7.297 ns 0.1657 ns 0.1469 ns 1.66 - NA
baseline* 256 8.086 ns 0.0577 ns 0.0482 ns 1.70 - NA
Awaiten 256 4.764 ns 0.1271 ns 0.1189 ns 1.00 - NA
MsDI 256 4.177 ns 0.0428 ns 0.0380 ns 0.88 - NA
Autofac 256 59.937 ns 0.7840 ns 0.7334 ns 12.59 656 B NA
Jab 256 66.725 ns 0.4422 ns 0.3920 ns 14.01 - NA
PureDI 256 2.891 ns 0.0766 ns 0.0716 ns 0.61 - NA
DryIoc 256 4.609 ns 0.1538 ns 0.1363 ns 0.97 - NA
SimpleInjector 256 6.234 ns 0.1402 ns 0.1170 ns 1.31 - NA
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 26.04.1 LTS (Resolute Raccoon)
AMD EPYC 7763 2.86GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.303
[Host] : .NET 10.0.14 (10.0.14, 10.0.1426.52326), X64 RyuJIT x86-64-v3

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Build Size Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 8 20.91 ns 1.053 ns 0.985 ns 1.10 208 B 1.00
Awaiten 8 19.07 ns 0.189 ns 0.176 ns 1.00 208 B 1.00
MsDI 8 1,455.37 ns 8.144 ns 6.800 ns 76.32 5688 B 27.35
Autofac 8 30,318.00 ns 131.238 ns 109.590 ns 1,589.91 32482 B 156.16
Jab 8 13.22 ns 1.335 ns 1.249 ns 0.69 96 B 0.46
PureDI 8 14.93 ns 0.486 ns 0.406 ns 0.78 128 B 0.62
DryIoc 8 895.72 ns 2.702 ns 2.395 ns 46.97 1528 B 7.35
SimpleInjector 8 11,600.39 ns 62.624 ns 52.294 ns 608.34 24761 B 119.04
baseline* 256 171.22 ns 13.908 ns 13.009 ns 1.10 4176 B 1.00
Awaiten 256 155.30 ns 1.898 ns 1.585 ns 1.00 4176 B 1.00
MsDI 256 14,454.70 ns 213.808 ns 199.996 ns 93.08 61016 B 14.61
Autofac 256 762,838.04 ns 6,590.333 ns 6,164.602 ns 4,912.39 738348 B 176.81
Jab 256 81.93 ns 3.300 ns 2.925 ns 0.53 2080 B 0.50
PureDI 256 90.14 ns 2.181 ns 2.040 ns 0.58 2112 B 0.51
DryIoc 256 44,772.92 ns 886.176 ns 828.929 ns 288.32 80645 B 19.31
SimpleInjector 256 370,676.11 ns 6,689.010 ns 6,256.904 ns 2,387.01 573043 B 137.22

baseline* rows show the corresponding Awaiten benchmark from the most recent successful main branch build with results, for regression comparison.

github-actions Bot added a commit that referenced this pull request Oct 30, 2026
github-actions Bot added a commit that referenced this pull request Oct 30, 2026
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