Asteroid.General.CompilerTools 0.3.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Asteroid.General.CompilerTools --version 0.3.2
                    
NuGet\Install-Package Asteroid.General.CompilerTools -Version 0.3.2
                    
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="Asteroid.General.CompilerTools" Version="0.3.2">
  <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="Asteroid.General.CompilerTools" Version="0.3.2" />
                    
Directory.Packages.props
<PackageReference Include="Asteroid.General.CompilerTools">
  <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 Asteroid.General.CompilerTools --version 0.3.2
                    
#r "nuget: Asteroid.General.CompilerTools, 0.3.2"
                    
#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 Asteroid.General.CompilerTools@0.3.2
                    
#: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=Asteroid.General.CompilerTools&version=0.3.2
                    
Install as a Cake Addin
#tool nuget:?package=Asteroid.General.CompilerTools&version=0.3.2
                    
Install as a Cake Tool

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 with Enum.
  • AST1011: enums marked with FlagsAttribute end with Flags.
  • 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) and file-local types.
  • AST1013: file name should match type name — partial part files may use TypeName_Part.cs / TypeName.Part.cs.
  • AST1015: private static fields begin with s_.
  • 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 AST1014 with a reason comment.
  • AST1024: identifiers must be ASCII — any code point above 127 is rejected, checked on decoded identifier text so \uXXXX escapes 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, #region labels and #pragma trailing 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 runs System runs come first and group heads ascend; the section is separated from the following declaration by a blank line. Sort and group checks apply only when dotnet_sort_system_directives_first and dotnet_separate_import_directive_groups are enabled; forms the organizer leaves untouched (e.g. same-root runs separated by a blank line) are never flagged, so every reported shape is one asteroid code fix-all can fix.

Responsibility

Asteroid.General.CompilerTools 包含不属于特定运行时模块的框架级分析器,不包含源生成器 或模块专用语义检查。

Distribution

开发仓库直接将项目作为分析器引用。分发用 Framework 仓库默认使用 NuGet 包。该包将 分析器程序集放在 analyzers/dotnet/cs 下,并提供 buildTransitive 目标,使规则传递到 下游项目。

Enum Naming

普通枚举使用 Enum 后缀;标记 System.FlagsAttribute 的枚举使用 Flags 后缀。这是 Asteroid 有意采用的命名约定,独立于 .NET 默认命名规则执行。

There are no supported framework assets in this package.

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.

Version Downloads Last Updated
0.3.5 57 11/18/2026
0.3.4 117 10/26/2026
0.3.3 131 10/6/2026
0.3.2 109 9/25/2026
0.3.1 118 9/23/2026
0.3.0 106 9/23/2026
0.2.3 126 9/19/2026
0.2.2 124 9/8/2026
0.2.1 325 9/7/2026
0.2.0 128 8/30/2026
0.1.2 124 8/28/2026
0.1.1 168 8/21/2026
0.1.0 176 8/20/2026