Skip to content

提供添加文件头部信息的分析器和修复器 #8

@vipwan

Description

@vipwan

首先添加Biwen.AutoClassGen.Comment文件到项目根目录,格式如下:

请注意: 严格约定配置项的首字母大写

// Licensed to the {Product} under one or more agreements.
// The {Product} licenses this file to you under the {Copyright} license. 
// See the LICENSE file in the project root for more information.13456789
// 1234 {Product} {File} 
// {Date}  {Title} {Author} {Company}

项目文件.csproj中如果包含如下的配置项将会被引用,否则将会使用缺省值!

<Project Sdk="Microsoft.NET.Sdk.Web">
	<PropertyGroup>
		<TargetFramework>net8.0</TargetFramework>
		<Description>This is a test console App</Description>
		<Copyright>MIT</Copyright>
		<Company>Inc</Company>
		<Authors>万雅虎</Authors>
	</PropertyGroup>
	<Import Project="../Version.props" />
</Project>

支持的变量有: Date,File,Title,Author,Product,Copyright,Version

.cs源文件不存在头部信息时分析器将生成GEN050警告信息,

image

提供的修复器如下:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions