Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Annotate auto-generated code

オープン
#2,588 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
csharp
領域
tooling

調査の方向性

Start by locating the source generator that emits files such as Functions_Handle_Generated.g.cs and tracing how it builds the generated header and type declarations. Add the requested generated-code and coverage annotations to generated types and applicable members, and replace the header with the descriptive block shown in the issue. Verify generated output includes these annotations and header.

索引モデルが issue の本文から書いたものです。

説明

feature-request needs-triage
Describe the feature

The source generator's output (e.g. Functions_Handle_Generated.g.cs) has no attributes that identify it as
generated code, and only the minimal // <auto-generated/> header. Please:

  1. Add [GeneratedCode("<tool>", "<version>")] to every generated type (and member where it applies).
  2. Replace the one-line header with the standard descriptive <auto-generated> block.
  3. Add [ExcludeFromCodeCoverage] to generated types.
Use Case

As a developer enforcing code-quality gates (coverage thresholds, static analysis) on Lambda projects,
I need the generated handler code to identify itself as generated ([GeneratedCode], [ExcludeFromCodeCoverage] and a full <auto-generated> header),
so that coverage and analysis tools exclude it automatically, without per-repository exclusion rules.

Today the generated *_Generated class is indistinguishable from hand-written code once compiled. It lowers
reported coverage, appears in analyzer and mutation-testing results, and cannot be annotated by the user. Each
repository has to maintain its own tool-specific exclusion.

Proposed Solution

Generated code is annotated with

  • <auto-generated> comment
  • GeneratedCode attribute
  • ExcludeFromCoverage attribute

Sample output:

// <auto-generated>
//     This code was generated by a tool (Amazon.Lambda.Annotations.SourceGenerator 2.4.1.0).
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>

using System;
...
namespace Acme.EventDistributor.Trigger
{
    /// <summary>
    /// The generated Lambda function handler for <see cref="Acme.EventDistributor.Trigger.Functions"/>.
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("Amazon.Lambda.Annotations.SourceGenerator", "2.4.1.0")]
    [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
    public class Functions_Handle_Generated
    {
Other Information

No response

Acknowledgements
  • I may be able to implement this feature request
  • This feature might incur a breaking change
AWS .NET SDK and/or Package version used

Amazon.Lambda.Annotations 2.4.1.0

Targeted .NET Platform

.NET SDK 10.0.401

Operating System and version

Windows 11

主要言語
C#
スター
1.7k
フォーク
505
平均マージ
1日 6時間
マージ済み PR(30日)
10

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

aws/aws-lambda-dotnet のほかの issue

aws/aws-lambda-dotnet の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。