Asteroid.General.CompilerTools
0.3.3
See the version list below for details.
dotnet add package Asteroid.General.CompilerTools --version 0.3.3
NuGet\Install-Package Asteroid.General.CompilerTools -Version 0.3.3
<PackageReference Include="Asteroid.General.CompilerTools" Version="0.3.3"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="Asteroid.General.CompilerTools" Version="0.3.3" />
<PackageReference Include="Asteroid.General.CompilerTools"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Asteroid.General.CompilerTools --version 0.3.3
#r "nuget: Asteroid.General.CompilerTools, 0.3.3"
#:package Asteroid.General.CompilerTools@0.3.3
#addin nuget:?package=Asteroid.General.CompilerTools&version=0.3.3
#tool nuget:?package=Asteroid.General.CompilerTools&version=0.3.3
Asteroid.General.CompilerTools
General coding convention analyzers shared by Asteroid framework modules and their consumers.
The package is a development dependency. Its analyzers are automatically
applied through buildTransitive; consumers do not add analyzer references
manually.
Current rules:
AST1010: ordinary enum type names end withEnum.AST1011: enums marked withFlagsAttributeend withFlags.AST1012: one type name per file — legitimate cohabitation only for same-name families (partial/generic arity), same-file extension classes (Foo/IFoo↔FooExtensions, naming convention), paired interface (IFoo+Foo, class-anchored filename) andfile-local types.AST1013: file name should match type name — partial part files may useTypeName_Part.cs/TypeName.Part.cs.AST1015: private static fields begin withs_.AST1016: private instance fields begin with_.AST1014: a source file should stay within 600 lines — split by responsibility into partial part files (TypeName_Part.cs). Exempt: generated files (.g.cs,<auto-generated />first line,obj/bin), and machine-table data files via an in-file#pragma warning disable AST1014with a reason comment.AST1024: identifiers must be ASCII — any code point above 127 is rejected, checked on decoded identifier text so\uXXXXescapes and verbatim@forms are covered, across all declaration positions including ones exempt from the naming-style gates (underscore-prefixed engine hook members, private fields). Comments, string literals,#regionlabels and#pragmatrailing text are not restricted (Chinese comments are the repo convention). One diagnostic per distinct name per file.AST1025: source file names must be ASCII — the file-name segment only; directory segments are consumer-environment paths (a repo cloned into a non-ASCII directory must not trip the gate) and are out of scope.AST1026: the using section must be in organized form — each blank-line separated run holds one kind of directive (using/using static/ alias) and, for plain usings, one root namespace, sorted by name; runs go regular → static → alias; among regular runsSystemruns come first and group heads ascend; the section is separated from the following declaration by a blank line. Sort and group checks apply only whendotnet_sort_system_directives_firstanddotnet_separate_import_directive_groupsare enabled; forms the organizer leaves untouched (e.g. same-root runs separated by a blank line) are never flagged, so every reported shape is oneasteroid code fix-allcan fix.
Responsibility
Asteroid.General.CompilerTools 包含不属于特定运行时模块的框架级分析器,不包含源生成器
或模块专用语义检查。
Distribution
开发仓库直接将项目作为分析器引用。分发用 Framework 仓库默认使用 NuGet 包。该包将
分析器程序集放在 analyzers/dotnet/cs 下,并提供 buildTransitive 目标,使规则传递到
下游项目。
Enum Naming
普通枚举使用 Enum 后缀;标记 System.FlagsAttribute 的枚举使用 Flags 后缀。这是
Asteroid 有意采用的命名约定,独立于 .NET 默认命名规则执行。
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.