TC.Tier.Analyzers 1.0.0-alpha.10

This is a prerelease version of TC.Tier.Analyzers.
dotnet add package TC.Tier.Analyzers --version 1.0.0-alpha.10
                    
NuGet\Install-Package TC.Tier.Analyzers -Version 1.0.0-alpha.10
                    
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="TC.Tier.Analyzers" Version="1.0.0-alpha.10">
  <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="TC.Tier.Analyzers" Version="1.0.0-alpha.10" />
                    
Directory.Packages.props
<PackageReference Include="TC.Tier.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 TC.Tier.Analyzers --version 1.0.0-alpha.10
                    
#r "nuget: TC.Tier.Analyzers, 1.0.0-alpha.10"
                    
#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 TC.Tier.Analyzers@1.0.0-alpha.10
                    
#: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=TC.Tier.Analyzers&version=1.0.0-alpha.10&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=TC.Tier.Analyzers&version=1.0.0-alpha.10&prerelease
                    
Install as a Cake Tool

TC.Tier.Analyzers

配置驱动的分层治理与代码纪律分析器包。规则、作用域、豁免全部经 .editorconfig 声明—— 零默认诊断:装包未配置 = 零报告,对消费方零打扰。

使用指南(快速上手/规则清单/豁免纪律/反模式):docs/tier-analyzers.md

安装

<PackageReference Include="TC.Tier.Analyzers" Version="1.0.*" PrivateAssets="all" />

规则族与诊断 ID

件一:分层依赖(tier_layer.*)

ID 规则 配置键
TCSG130 禁用引用(元数据引用 / using 命名空间双形态) tier_layer.forbidden_reference = A => B1 \| B2 ; …
TCSG131 零内部依赖违约 tier_layer.zero_internal_refs = X1 ; X2
—(131 依赖) 内部家族前缀定义 tier_layer.internal_assembly_prefix = TC.Traffic.
TCSG132 引用白名单越界 tier_layer.allowed_reference = X => Y1 \| Y2 ; …
TCSG133 命名空间归属越界 tier_layer.namespace_prefix = X => P ; …
—(132 依赖) 框架豁免前缀追加 tier_layer.allowed_framework_prefix = Foo \| Bar

件二:禁用模式(tier_forbidden.*)

ID 规则 pack 令牌
TCSG134 裸线程原语(new Thread / Thread.Sleep / Task.Run / PeriodicTimer / SemaphoreSlim / Mutex / ManualResetEvent(Slim)) bare_threads
TCSG135 热路径分配纪律(LINQ / 装箱 / string 分配——启发式契约) hotpath_discipline
TCSG136 禁止运行时反射 reflection
TCSG137 禁 sync-over-async(.GetAwaiter().GetResult() / .Wait()) sync_over_async
TCSG138 禁 fire-and-forget 丢弃(_ = 丢弃 Task/ValueTask) fire_and_forget
tier_forbidden.pack = reflection | sync_over_async | fire_and_forget | bare_threads | hotpath_discipline
tier_forbidden.scope.hotpath_discipline = members_with([Acme.HotPathAttribute])
tier_forbidden.exempt.bare_threads = Acme.Execution | Acme.Infrastructure.Scheduler

值编码

  • 单键值内 ; 分隔多条规则;| 列举多目标 / pack 令牌;空白容忍。
  • 箭头对 左值 => 右值1 | 右值2;左值 = 程序集名(精确,或 前缀* 通配),不匹配任何程序集名时按 命名空间前缀解释(仅 using 形态生效——命名空间粒度作用域)。
  • 配置非法 fail-fast(TCSG139):未知键、坏语法、规则依赖键缺失 = Error,绝不静默忽略。

想深入

  • 诊断 ID 段位规划见仓库 docs/design/analyzer-configuration-design.md(内部文档)。
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • 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.0-alpha.10 53 9/25/2026
1.0.0-alpha.9 46 9/25/2026
1.0.0-alpha.8 54 9/23/2026
1.0.0-alpha.7 48 9/21/2026
1.0.0-alpha.6 50 9/20/2026
1.0.0-alpha.5 51 9/20/2026
1.0.0-alpha.4 50 9/19/2026
1.0.0-alpha.3 50 9/18/2026
1.0.0-alpha.2 50 9/18/2026
1.0.0-alpha.1 49 9/16/2026